Flash is not read/writable when booted from flash by advanced bootloader

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
Steve Cho
Offline
Last seen:2 years 5 months ago
加入:2018-04-10 01:03
Flash is not read/writable when booted from flash by advanced bootloader

Hi Dialog-semi,

When I burn the hex file of my application to flash memory(by advanced bootloader of SmartSnippets Toolbox - SPI Flash Programmer), the application does not work on the point which read and write data to flash memory.
Of ocurse, My application is working well when is booted from RAM, booting from Keil.

I saw the previous post write "function: spi_flash_release_from_power_down()".

But
1) I would like to know the document related upper function.
2) In other words, I want to know where to put this function in my application program.
3) I want to know at what address to write data of my application to flash memory.

Best regards,

Steve

Device:
PM_Dialog
Offline
Last seen:4 days 9 hours ago
工作人员
加入:2018-02-08 11:03
Hi Steve Cho,

Hi Steve Cho,

There is any specific document related with the spi_flash_release_from_power_down() function. If you would like to check how this function is working, you can check the source code of spi_flash.c driver. According to the driver, this function sends the Release from Power-Down instruction. So you should put this function before you are going to read/write data into the SPI Flash. Can you please check if the SPI Flash is powered down when you are trying to read/write data? You can write data in whichever address you want, but you should check that your data will not override the bootloader placed into the SPI Flash.

Thanks, PM_Dialog

Steve Cho
Offline
Last seen:2 years 5 months ago
加入:2018-04-10 01:03
Thank you for your reply.

Thank you for your reply.

spi闪存内部flashmemory because it uses DA14583.
So how do you know if spi flash is power down?
Secondary_bootloader uses 5.0.4 / utilities / secondary_bootloader / secondary_bootloader.uvprojx and application has burned application.hex file into inner flash by "SPI Flash Programmer" in SmartSnippets Tool box.
So, could you tell where address to read and write data in the inner flash memory?

Best regards,
Steve

PM_Dialog
Offline
Last seen:4 days 9 hours ago
工作人员
加入:2018-02-08 11:03
Hi Steve Cho,

Hi Steve Cho,

There is no any specific way to know if the SPI flash is powered on/off. If you call the spi_flash_power_down() function from spi_flash.c driver, the SPI flash will be powered down and if you would like to release it from power of you should call the spi_flash_release_from_power_down() function. Before reding or writing your data you should call the spi_flash_release_from_power_down() in order to be sure that the SPI flash is powered on. Regarding your second question, you can write in whichever address you want your data, but you should not override the secondary bootloader binary image. Be aware that the DA14583 has a pre-programmed secondary bootloader in OTP.

Thanks, PM_Dialog