Skip to content

Conversation

@LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Aug 24, 2021

Mbed OS builds .bin images by default for most targets, but many targets (e.g. ST targets running the latest ST-LINK firmware) also support .hex files, making this demo much easier to prepare. In case a target doesn't support .hex files, README.md already contains steps for merging .hex files into a single one and converting it to a .bin file.

The majority of flash devices support reading single bytes without alignment concerns. The config mcuboot.read-granularity enables additional code to handle read alignment, and it comes with a slight code size and performance overhead. So disable it on DISCO_L475VG_IOT01A.

Also update README for AGlass0fMilk/mbed-mcuboot-blinky#4.

@AGlass0fMilk

Mbed OS builds .bin images by default for most targets, but many
targets (e.g. ST targets running the latest ST-LINK firmware) also
support .hex files, making this demo much easier to prepare. In
case a target doesn't support .hex files, README.md already contains
steps for merging .hex files into a single one and converting it to
a .bin file.
The majority of flash devices support reading single bytes without
alignment concerns. The config `mcuboot.read-granularity` enables
additional code to handle read alignment, and it comes with a slight
code size and performance overhead.
@LDong-Arm LDong-Arm changed the title Generate hex image for all targets by default Improve support for DISCO_L475VG_IOT01A Aug 24, 2021
"mcuboot.scratch-size": "0x20000",
"mcuboot.max-img-sectors": "0x180",
"mcuboot.read-granularity": 1,
"qspif.QSPI_MIN_PROG_SIZE": 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There doesn't seem to be a default for this in targets.json. Could the absence of this cause bd r/w to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default for all targets is defined to be 1 here: https://github.com/ARMmbed/mbed-os/blob/f6e165febec105c042137a4d1bf663a58968aac8/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json#L21
So DISCO_L475VG_IOT01A has it set to 1.

Also, we can remove the override for EP_AGORA and NRF52840_DK too, because they both inherit MCU_NRF52840 which is already set to 4: https://github.com/ARMmbed/mbed-os/blob/f6e165febec105c042137a4d1bf663a58968aac8/storage/blockdevice/COMPONENT_QSPIF/mbed_lib.json#L40

Copy link
Contributor Author

@LDong-Arm LDong-Arm Aug 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a commit to further clean this up for MCU_NRF52840

@ghost
Copy link

ghost commented Aug 25, 2021

Unrelated to the PR: why exclude CC310 from the NRF52840_DK and EP_AGORA configs?

The latest Mbed OS already has `qspif.QSPI_MIN_PROG_SIZE` set to 4
for MCU_NRF52840 which is the base target of NRF52840_DK and EP_AGORA.
@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Aug 25, 2021

Unrelated to the PR: why exclude CC310 from the NRF52840_DK and EP_AGORA configs?

@AGlass0fMilk Presumably this is to reduce code size? MCUboot needs crypto APIs from mbedtls (which is in the "requires" field of mbed_app.json), but the bootloader doesn't need the complete hardware support.

@AGlass0fMilk
Copy link
Owner

Unrelated to the PR: why exclude CC310 from the NRF52840_DK and EP_AGORA configs?

@noonfom @LDong-Arm

The nRF52840 CC310 driver has never worked properly for me and causes hard faults. If you can test it with CC310 enabled and do not encounter hard faults we can re-enable it.

@sudotensor sudotensor mentioned this pull request Sep 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants