edgetx icon indicating copy to clipboard operation
edgetx copied to clipboard

feat: bootloader support for SPI NOR flash storage

Open richardclli opened this issue 1 year ago • 8 comments

This PR add support to initialize SPI NOR flash in horus and nv14 targets:

  1. Add storage initialization function in bootloader
  2. Add placeholders for user to select the use of SPI NOR flash instead of SD card for storage

richardclli avatar Jan 16 '24 03:01 richardclli

I have added TX16S support. Need to change the commented lines in CMakelist.txt and hal.h to test it out.

richardclli avatar Jan 16 '24 03:01 richardclli

This sounds cool! I should try it out!

raphaelcoeffic avatar Mar 29 '24 13:03 raphaelcoeffic

I think Raphael still thinking how to make use of internal NOR flash together with SD card. Need to enable the support of multiple volume of FatFS to really make use of it. This PR just enable the exploration of usage by adding something in BL to init the NOR flash volume for feature explorarion.

richardclli avatar Jun 08 '24 23:06 richardclli

Just like the flashing firmware, it need a long press [Enter] to erase.

richardclli avatar Jun 24 '24 21:06 richardclli

Just like the flashing firmware, it need a long press [Enter] to erase.

No. The sequence is currently Erase Flash Storage => Erase Flash Storage (Hold [ENT] long to erase) => "This may take up to 200s" => 10 minutes later, short press of ENT... several seconds later returns to main screen, flash has been erased. The short press of ENT should not have been needed for the erase to actually happen ;)

pfeerick avatar Jun 28 '24 01:06 pfeerick

This behavior should be the same as PL18, I never need the short press [Enter], after wait should just return.

richardclli avatar Jun 30 '24 04:06 richardclli

I'll have to check on the PL18EV, but I bet you do... not sure this is right? Looks like it is halting until ENTER release when in the ST_CLEAR_FLASH phase... for all SPI_FLASH enabled targets ;)

https://github.com/EdgeTX/edgetx/blob/cf32dbbed40da88bbb381354cb061b043c02a6e8/radio/src/targets/common/arm/stm32/bootloader/boot.cpp#L534-L535

pfeerick avatar Jun 30 '24 04:06 pfeerick

I'll have to check on the PL18EV, but I bet you do... not sure this is right? Looks like it is halting until ENTER release when in the ST_CLEAR_FLASH phase... for all SPI_FLASH enabled targets ;)

https://github.com/EdgeTX/edgetx/blob/cf32dbbed40da88bbb381354cb061b043c02a6e8/radio/src/targets/common/arm/stm32/bootloader/boot.cpp#L534-L535

This should be common to all targets.

richardclli avatar Jun 30 '24 09:06 richardclli

I just verified on PL18EV that this same behaviour was happening. It did not happen on 2.10 bootloader, however, so most likely stemmed from one of the key handing change PRs... with those lines removed it works as expected.

pfeerick avatar Jul 02 '24 09:07 pfeerick