⚠️
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
dlo
Offline
Last seen:5 days 16 hours ago
Joined:2017-05-26 16:21
Dialog Beacon Code

I am using the Beacon v5.40.2 code provided by Dialog to develop my product.

我想使用OTP中的代码没有外面的al flash. I think there might be some dependencies I need to change, but I can't find all of them.

I think this is one I need to comment out:
/*
Comment/Uncommment SW configuration switches to include/exclude from build
*/
#define CFG_CONFIG_STORAGE // When defined the configuration struct is read from flash

I am testing each build by loading the hex file into RAM and see if it shows up on the beacon scanner app, but so far I haven't been able to find all the flash dependencies to make this run properly without external flash.

My test setup is two identical boards with footprint for external flash, one of them is loaded with a chip and the other one is not populated. The one with the flash runs fine with the standard code, but that same code does not run on the board without flash.

Please help identify the flash dependent code sections.

Thank you!

Keywords:
Device:
PM_Dialog
Offline
Last seen:21 hours 41 min ago
Staff
Joined:2018-02-08 11:03
Hi dlo,

Hi dlo,

The CFG_CONFIG_STORAGE is the proper #define that should be removed in order to build the firmware for OTP with no flash access and also you won’t be able to use SUOTA profile since it requires the flash in order to perform the update. Also in order to operate with no flash access you need to comment out a couple of lines in the user_on_init() function that interact with the flash (there are instructions on the comments regarding which lines you should comment out in the code of that specific function). Also you should remove the spi_flash_release_from_power_down() function from the error handlers (NMI_Hanlder() Hardfault_Handler() and wrap_platform_reset()).

Thanks, PM_Dialog

dlo
Offline
Last seen:5 days 16 hours ago
Joined:2017-05-26 16:21
In user_config.h I commented

In user_config.h I commented out
#define CFG_CONFIG_STORAGE

In user_on_init(void) I commented out:
spi_flash_enable(SPI_EN_GPIO_PORT, SPI_EN_GPIO_PIN);
spi_flash_power_down();

Then I commented out spi_flash_release_from_power_down() in:
void HardFault_HandlerC(unsigned long *hardfault_args)
void NMI_HandlerC(unsigned long *hardfault_args)
void wrap_platform_reset(uint32_t error)

Now the hex file doesn't work on either boards (with or without flash).

I am loading the hex using the booter from SmartSnippets Toolbox.

PM_Dialog
Offline
Last seen:21 hours 41 min ago
Staff
Joined:2018-02-08 11:03
Hi dlo,

Hi dlo,

If you dont include the SUOTA profile in your build then you will not be able to access the SPI Flash. If you include the SUOTA build and expose the SUOTA service on the user and the user tries to update the fw then yes the fw will crash since the code will try to access a non-existing flash. Regarding the fact that the fw doesn't run when doing the above mods, tried this on a pro kit and the beacon was advertising as it should, so you will have to debug this, please check with a debugger where the code stalls and when the device ends up when running the modified sw.

Thanks, PM_Dialog