Closed protectivedad closed 10 months ago
You're on the right path here. Thumbs up for reading the documentation!
However, I think the partition layout needs the start address AND length (separated by a colon). So, it'd be "0xB000:0xAF000". The partition is named "ota1" (or "xip1" I'm not sure), not "app". Make sure to also add the appropriate record for OTA2 partition - start offset 0xBA000, same length.
Thanks for taking the time. Using:
platformio_options:
custom_flash.ota1: "0x0B000:0xAF00"
custom_flash.ota2: "0xBA000:0xAF00"
Gives the error:
HARDWARE: RTL8710BN 125MHz, 256KB RAM, 788KB Flash
- framework-arduino-api @ 2022.8.24+sha.237b10a
- framework-realtek-amb1 @ 0.0.0+v2022.06.21.sha.c4e44ef
- library-flashdb @ 1.2.0+sha.d5c892f
- library-freertos @ 8.1.2+sha.776ae6c
- library-freertos-port @ 2023.5.23+sha.a917d93
- library-lwip @ 2.1.3-amb1+sha.6297b80
- library-printf @ 6.1.0+sha.28a79bd
- library-uf2ota @ 5.0.0+sha.f955412
ValueError: invalid literal for int() with base 0: '0x0B000:0xAF000':
File "/home/anthony/.local/lib/python3.10/site-packages/platformio/builder/main.py", line 173:
env.SConscript("$BUILD_SCRIPT")
...
Tried with xip1 and xip2 same error. Comma, semicolon, all the same.
I looked trough the library code I see the FLASH_OTA[1,2]_[OFFSET,LENGTH]
variables but where they are assigned I can't find. It's like magic.
I remember now. It's "+", not a colon.
Yeah, just figured that also. Still doesn't work. The python code is slightly broken. The flash.py
(library-uf2ota) can only handle an offset, but the env.py
is broken if FLASH_IS_CUSTOM
is set.
Just adding:
custom_flash.ota2: "0x0BA000"
will create a usable `board.json:
"ota1": "0x00B000+0xAF000",
"ota2": "0x0BA000+0xDB000",
I'm fine with a larger second ota2 partition. But it flash.py
sets FLASH_IS_CUSTOM
which breaks env.py
.
Right. It does auto-calculation of other partitions; I forgot that the value in your yaml should be just the offset, without length (I've never actually used that option).
And yes, it seems that env.py
is broken - it tries to .partition()
the v
variable, which is probably a copy-paste error or something.
Until I fix this, you can use board_flash.app
and set it to both offset and length values, with +
in between. You have to set both partitions then. It won't recalculate the entire partition layout, so it might cause some unused space, or even overlapping partitions.
I see you beat me to it, haha.. merged the PR, thanks!
No problem.
Is there supposed to be an easy way to create a UF2 file with a custom app size. The boot log of my device looks like:
Notice that the OTA2 ADDR is 0x80ba000 which gives an app size of 700KB, so I am trying to create a uf2 file using that app size.
I used the
kickstart-rtl8710bn-2mb-788k.yaml
to create:But it errors with:
I tried using the
libretiny-esphome
but it gives the same error. Any help resolving this is appreciated.