BLE application from RAM

2 posts / 0 new
Last post
edwardwhite
Offline
Last seen:3 years 2 months ago
加入:2016-09-30 16:31
BLE application from RAM

Is it possible to create a BLE application that can be debugged with just the RAM?
The QSPI flash on our dev board has broken and we need to keep working on the firmware. All of the example projects only have QSPI build options, but I can't see a reason for this except for the sleep mode (which can be changed to always active)

Keywords:
Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
Staff
加入:2015-06-08 11:34
Hi edwardwhite,

Hi edwardwhite,

There is no BLE example that runs only in RAM, the reason for that is the size of the code cannot fit in the 128KB RAM + 16KB cache of the 68x, but you can build a project small enough, like the ble_central in order to run only to the RAM (the BLE manager, the BLE adapter etc have a quite large footprint). If the project that you have developed is large enough then there is no way to fit that in the sysram. Some mods that you will have to do in order to try to run your project only in sysram are the following:

  • Create a new configuration that will be active in your ble ram project custom_config_ram.h for example (exacly as the custom_config_qspi.h file but with a few mods). So just copy/paste the custom_config_qspi.h and modify it with the below mods.
  • For the build configuration that you will set for your RAM project, make sure that in the name field you have the xxxxxx_RAM post fix in order to be able to debug the RAM version of your configuration.
  • 包括新custom_config_ram.h你r include paths and in the Build Steps replace the _qspi with the _ram .h file (in the Pre-build steps in C/C++ Build Settings option)
  • undefine the dg_configEXEC_MODE MODE_IS_CACHED or comment it out.
  • define the dg_configCODE_LOCATION to NON_VOLATILE_IS_NONE
  • define the dg_configFLASH_CONNECTED_TO to FLASH_IS_NOT_CONNECTED
  • set the dg_configPOWER_1V8_ACTIVE and dg_configPOWER_1V8_SLEEP both to 0
  • the dg_configFLASH_ADAPTER, dg_configNVMS_ADAPTER, dg_configNVMS_VES configure it as 0
  • You will have to remove any SUOTA implementation from your build, so you can set the dg_configSUOTA_SUPPORT to 0.
  • In the ad_ble.c you should change the macro ADAPTER_INIT_DEP1(ad_ble_adapter, ad_ble_init, ad_nvms_adapter); to ADAPTER_INIT(ad_ble_adapter, ad_ble_init); since there is no NVMS module, the BLE adapter should be initialized without any dependancy.
  • After the above and since you verify that the compilation succeeds you should experiment with the size of each section in order to get the project to link properly for example decrease the size of the RTOS heap (this is what i had to do in order for the ble_central project to compile).

Thanks MT_dialog