Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Secure bootloader USB PCA10100e won't work.

Hello,

I am trying to work with the DFU examples provided with the SDK. My board is a custom USB dongle to which I need to add the bootloader. Following the steps from here (https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/sdk_app_serial_dfu_bootloader.html?cp=8_1_4_4_4), I managed to get the example working with the NRF52840, but not whith the NRF52820.

The project I am facing issues is "secure_bootloader_usb_mbr_pca10100e - nrf52820xxaa". As required for the project to compile, I built the micro-ecc lib and added to the folder. After building, the hex file is programmed into the device using: "nrfjprog --reset --program bootloader_52820.hex --family NRF52 --sectoranduicrerase" (renamed the bootloader hex file for simplicity).

It is expected that, after program, the device should sow up as a CDC interface for windows. When using the NRF52840, all goes well and I am able to perform DFU. But, when I program the NRF52820, nothing happens. I can see the device memory is prgrammed (via nrfConnect), including the softdevice (s112/s122 for 52820 or s140 for 52840) that was previously added.

So I tried to debug, hoping I would see something throw an error message. But this where it gets weird.. the debugger don't even reach the main routine as it is stopping in a HardFault exception:

The processor has escalated a configurable-priority exception to HardFault.

   A coprocessor access error has occurred (CFSR.NOCP).

Exception occurred at PC = 0x3d470, LR = 0x3d511

See the call stack for more information.

And, at the Call Stack has the following call: [__iar_dadd + 0xd1]

My environment is:

- nRF5 SDK v17.1.0;

- IAR 9.10.2;

- Boards: PCA10059 and custom nRF52820 dongle;

I know that my custom board is working fine, as I already have plenty of code working on it (including USB custom HID and NUS).

Could anyone help me?

Parents
  • Hello,

    Can you please try the pca10100e_usb_debug project, and see if you can get any logging from the bootloader device?

    Also, if you are actually running this on an nRF52820, did you remove the DEVELOP_IN_NRF52833 preprocessor definition before compiling the bootloader?

    Best regards,

    Edvin

Reply
  • Hello,

    Can you please try the pca10100e_usb_debug project, and see if you can get any logging from the bootloader device?

    Also, if you are actually running this on an nRF52820, did you remove the DEVELOP_IN_NRF52833 preprocessor definition before compiling the bootloader?

    Best regards,

    Edvin

Children
  • Hi Edvin, thanks for your support.

    I tried both with and without DEVELOP_IN_NRF52833 definition and also the debug project, as you suggest. Had the same results as before.

    Any other idea? Could it be related to linker definitions? Softdevice? Maybe some configuration on nrf_dfu_settings.c?

  • Edvin said:

    Can you please try the pca10100e_usb_debug project, and see if you can get any logging from the bootloader device?

    Please try this, and see if the log from the bootloader prints anything. If you have a debugger connected, you have everything you need to use RTT logging. No extra pins required, and the logging is already enabled in sdk_config.h. What does the log say?

    You can use Segger RTT Viewer to monitor the log.

    BR,

    Edvin

  • Edvin, I might not have been clear. I did tested pca10100e_usb_debug. There is no relevant data being output to RTT Viewer. See the attached image.

  • is the main() function in your bootloader reached? Have you tried setting a breakpoint in the bootloader's main.c file?

    Do you program the softdevice before you test? You need either the softdevice or the MBR to jump to the bootloader.

    BR,

    Edvin

  • Hi Edvin, as I said before, the code doesn't reach the main routine.

    So I tried to debug, hoping I would see something throw an error message. But this where it gets weird.. the debugger don't even reach the main routine as it is stopping in a HardFault exception:

    Anyway, I found the problem. Had to rebuild the micro-ecc library (same thing happened for this case with nRF52805). There might be some incompatibility with older builds of micro-ecc. I will post here the compiled libs in case someone need it. I just don't really understand why wouldn't nordic already provide this with the sdk package. Just replace the existing micro-ecc folder under the SDK_root/external.

    micro-ecc.rar

Related