This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Application Never Reaches main()

Hi

I have been trying to get example ble_app_hrs to run after compilation on my 52832 dev board (pca10040).

The specific example is: C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Examples\11.0.0-2.alpha\ble_peripheral\ble_app_hrs\pca10040\s132\arm5

I have reset the board using nRFtools.

The application nrf52832_xxaa  compiles, and downloads, the Softdevice (which I assume I also need to manually compile), appears to be available in the via the drop-down 'select target' option in keil. I change to this and see a load of errors in the files list.

Attempting to compile this gives the error:

Rebuild target 'flash_s132_nrf52_6.0.0_softdevice'
error - cannot create command input file '..\..\..\..\..\..\components\softdevice\s132\hex\main.__i'
Target not created.

The application wont run to main - I assume this is because the soft-device is not present?

I am using Keil uVision 5.23 together with nRF SDK 15.0.0_a53641a 

If I program the pre-built hex file E:\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_hrs\hex\ble_app_hrs_pca10040_s132.hex then it works just fine.

Using NRF tools, I then erased the board, programmed the default 132 soft-device found at:

E:\nRF5_SDK_15.0.0_a53641a\components\softdevice\s132\hex\s132_nrf52_6.0.0_softdevice.hex

And then re-built and re-deployed the application from:

C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Examples\11.0.0-2.alpha\ble_peripheral\ble_app_hrs\pca10040\s132\arm5

This appears to give me something that works - eventually, but begs the questions:

- Why will the softdevice present in the actual example not compile?

- Are all soft devices (I note there are loads and loads of pre-compiled hex files in the example code) all identical to one another - for the same version eg 132 ??

- Are softdevices always loaded at the same location in the devices' flash storage - I am assuming so otherwise there is no way the libs could be referenced?

You'll gather from the above that I am new to this!

My config is thus:

  • Should clarify the title... My question evolved as I was typing - and I solved some of it. The reason (I think) that I was not getting to main() was due to a missing/invalid softdevice.

    The other thing I don't entirely get are the 'correct' values for IROM1 and IRAM1 ... currently I appear to be plucking values out of a hat!

  • Your mixing SDK11 with the S132 V6 from SDK15, they are not API compatible. 

    I strongly urge you not to use the Keil Packs, but rather download and use SDK15 as is. 

  • Hi, thanks for the response,

    Yep, there is actually an error in my text above (as I mentioned I solved bits of my original question as I was typing out the forum post!). The actual example I have built/run is:

    E:\nRF5_SDK_15.0.0_a53641a\examples\ble_peripheral\ble_app_hrs\pca10040\s132\arm5_no_packs

    I still cannot compile the S132 softdevice that is included as a target in the above project though, gives the error:

    Rebuild target 'flash_s132_nrf52_6.0.0_softdevice'
    error - cannot create command input file '..\..\..\..\..\..\components\softdevice\s132\hex\main.__i'
    Target not created.

    Also, I seem to have to change the IRAM1/IROM1 settings to get the main target to compile/run under Flash --> Configure Flash Tools -- Target.

    Do you know the CORRECT values I should put in here, where the S132 soft device is being used with the application, but no bootloader?

    Nigel

  • The reason you are not able to build and compile the softdevice is because it is already an executable hex file ready to be loaded into the microcontroller. Building works by creating object files (.o) from .c and .h files, before assembling it all together into an executable file (e.g. hex file), which can be loaded into the microcontroller

    The solution is to just flash the softdevice hex file directly into the microcontroller

    Regarding IROM and IRAM size and start values, the default values should work fine. However, if wrong values are used, you will be provided with the right values when debugging.

    Best regards Simon Iversen

  • Thanks, I am a software dev really (windows device drivers), been dumped in at deep end here hence the silly questions. As I gain knowledge I am sure the questions will become less stupid!

Related