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

Getting IACCVIOL with S140 + nRF52840 + CrossWorks

Hello,

I have got the nRF52840-PDK, and I usually use CrossWorks, so I spun up a new project based on SDK 13, examples\peripheral\blinky and flashed this using default settings, with no soft device. LEDs blink so the environment is succesfully set up and the chip is working correctly.

I then attempted to load up examples\ble_peripheral\experimental_ble_app_blinky. I've set the flash to be delivered to 0x21000 as per S140 instructions, and set the RAM way higher at 0x20002800. However, I cannot get this to work. When I press 'Go' in CrossWorks, it writes to 0x21000, leaving the SoftDevice alone (I verify this using nRF Studio to verify S140 is on the chip) however I get a memory access violation when trying to run the app.

SCP>MMSR>IACCVIOL is set to 1, PC is at the instruction which caused the fault, 0x1FFA2, so inside the SoftDevice.

0001FFA2 ldr r1, [sp, #24]

Does anyone know what I am doing wrong here? All the directives are set up correctly, it is very strange. Also, if I do not start debugging, and instead just 'Download' the code to the chip, it does appear when I scan for it using nRF Connect mobile app, but when I connect it hard faults again with the same IACCVIOL, but a different location.

I would appreciate any help people could offer - I've been banging my head against this for a while.

EDIT: Of course, flashing the included hex file from the examples folder does give me a fully functioning Nordic_Blinky example I can control with my nRF Connect app, so the chip is working properly, just my compiled version is wrong?

Parents
  • So if I change to importing a Keil project I can get the Blinky BLE app to work :) not sure why mine isnt working as it should be the same... anyway.

    When I reset the application back to main, to start debugging, it appears the soft device is in the started state, because when I step over SOFTDEVICE_HANDLER_INIT the error handlers is invoked with error code 0x8.

    If I fully reset the chip and make it wait before calling into main, and I move it into main manually, it does work. So it looks like I cannot call SOFTDEVICE_HANDLER_INIT twice.

    Has any other crossworks user come across this?

    Also, I am unable to step through code handling any ble events, such as BLE_GATTS_EVT_WRITE, I can break in here but when I step over the code disappears back into the SoftDevice and ends up in error again.

Reply
  • So if I change to importing a Keil project I can get the Blinky BLE app to work :) not sure why mine isnt working as it should be the same... anyway.

    When I reset the application back to main, to start debugging, it appears the soft device is in the started state, because when I step over SOFTDEVICE_HANDLER_INIT the error handlers is invoked with error code 0x8.

    If I fully reset the chip and make it wait before calling into main, and I move it into main manually, it does work. So it looks like I cannot call SOFTDEVICE_HANDLER_INIT twice.

    Has any other crossworks user come across this?

    Also, I am unable to step through code handling any ble events, such as BLE_GATTS_EVT_WRITE, I can break in here but when I step over the code disappears back into the SoftDevice and ends up in error again.

Children
Related