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

Help activating bootloader logs on RTT

We successfully built the mesh bootloader, but want to get RTT working with the bootloader logs inside SEGGER.

We were following this two posts post1 post2 to achieve our goal.

After activating the -DBOOTLOADER_DEBUG_ENABLE=ON option on ninja and changing the declarations in the SEGGER_RTT.c file to

static char __attribute__((section(".rtt_ac_up"))) _acUpBuffer  [BUFFER_SIZE_UP];
static char __attribute__((section(".rtt_ac_down"))) _acDownBuffer[BUFFER_SIZE_DOWN];
SEGGER_RTT_CB __attribute__((section(".rtt_segger"))) _SEGGER_RTT;

I need to know where I can edit the SECTIONs used above. I think they have to be defined in a linker file, with the *.ld extension. For reference we are using a modified light switch client example from mesh sdk 3.1.0, that used softdevice version 6.1.0. We recently updated the project to use mesh SDK 3.2.0, and changed on the project definitions to use the 6.1.1 version of the softdevice in the additional load file option.

I have been searching around to pinpoint which .ld file the project uses. I supposed it was one inside the linker folder inside the project folder, but adding the SECTION definitions to the most recent .ld file does nothing, I get a 'region `UNPLACED_SECTIONS' overflowed by 1272 bytes' message regardless of the definition of the sections.

Parents
  • The linker folder inside the project folder doesn't seem to have any use. The linker script that matters is inside build/${name_of_project}_${build_type}/obj/${name_of_project}.ld.

    I think the flash_placement.xml file is used by SEGGER to generate the linker script referred above at build time, so we should edit flash_placement.xml.

  • rmarques said:
    I think the flash_placement.xml file is used by SEGGER to generate the linker script referred above at build time, so we should edit flash_placement.xml.

     That is correct. Segger embedded studio uses the falsh_placement.xml file for the flash placements, but I believe it also uses some of the project settings, so check project settings -> build -> Memory segments, and project settings -> linker -> section placement macros as well.

    It depends a bit on what you want to change how many of these you have to modify.

    You are talking about the mesh bootloader, or do you use the normal SDK's bootloader?

    Best regards,

    Edvin

  • Ok. What are the symptoms of your large firmware images not being able to run? 

    After a while I get "Abort event. Reason: 0x3" on the targets, due to receiving too many packets after a lost segment was requested and not received/processed by the bootloader, I think.

    The mesh DFU is a background DFU, meaning that the bootloader only copies the firmware to the correct placement once the upload is finished, so it doesn't handle the upload. 

    I know. Is there a proper way to upload a packet from the application side programmatically?

    I have tested the Mesh DFU with larger files, and it should work. Have you tried e.g. creating a DFU image of the dfu example? Does that work in your case?

    It did not, same thing as above. It did work with blinky though.

    Maybe you can tell me about the symptoms you see when it doesn't work? Do you get any messages returned from the nrfutil command when you try to update? Do you get any useful information from the application log on the nRF52840?

    I don't get anything useful on the nrfutil command, the sender board just keeps sending the packets until the end of the firmware image. I added some log messages inside the nrf_mesh_dfu_rx function in nrf_mesh_dfu.c so I could track the packets being received. I noticed that even though the lost packets were being asked for with the FFFB handle and received with the FFFA handle, after the second or third lost segment, FFFB handles were being sent from the target for packets already received with the FFFA handle.

    Also, can you tell me what version of SES you are using?

    SEGGER Embedded Studio for ARM
    Release 4.12  Build 2018112601.37855
    Linux x64

  • Ok. I have seen some weird behaviour in DFU when using the non-specified version of SES. Can you please try to use the one listed in the release notes of SDK15.2.0, which is the SDK  that is used with the Mesh SDK 3.1.0? That is, SES v3.40.

    I have never seen the error that you list before. Are you using the precompiled bootloader from the SDK?

    Can you please try to follow this guide, and let me know at what point your behavior differs from the guides?

    You can use another application than the blinky.hex. It shouldn't matter.

    I recommend writing a bat/sh script to generate the different files, and dfu image. Add some delay before starting the actual DFU to allow the applications to initialize before starting the DFU transfer. 

    Is the file that you generate matching the device page on the serial device? Or is it intended for the other nodes? If so, what application are the other nodes running? Is it based on the normal examples in the SDK, or the serial example found in SDK_for_mesh\examples\serial ?

    BR,

    Edvin

  • Ok. I have seen some weird behaviour in DFU when using the non-specified version of SES. Can you please try to use the one listed in the release notes of SDK15.2.0, which is the SDK  that is used with the Mesh SDK 3.1.0? That is, SES v3.40.

    I am using Mesh SDK 3.2.0, which uses SDK15.3.0, whose release notes report testing and verification with SES v4.12.

    I have never seen the error that you list before. Are you using the precompiled bootloader from the SDK?

    I am using the precompiled bootloader.

    Can you please try to follow this guide, and let me know at what point your behavior differs from the guides?

    I don't generate keys to keep it simple at first. I use blinky_nrf52840_xxAA_s140_6.1.1.hex and also update the --sd-req option when running nrfutil for SD 6.1.1, so instead of 0x00AF I use 0x00B6 and select the correct softdevice when flashing. The rest is the same.

    You can use another application than the blinky.hex. It shouldn't matter.

    That's my problem, it matters, the blinky.hex is 1.7KB and is very unlikely to fail a packet, the dfu example firmware image is larger than 100KB and much more likely to fail.

    I recommend writing a bat/sh script to generate the different files, and dfu image. Add some delay before starting the actual DFU to allow the applications to initialize before starting the DFU transfer. 

    This was one of the first things we did when starting to try the DFU feature. We use a script to generate device page and flash softdevice, bootloader, app and device page, and another script for the DFU transfer.

    Is the file that you generate matching the device page on the serial device? Or is it intended for the other nodes? If so, what application are the other nodes running? Is it based on the normal examples in the SDK, or the serial example found in SDK_for_mesh\examples\serial ?

    When intended for the device connected to serial it works, when intended for others it fails on the others, the problem is on the recovery of lost packets.

  • Sorry. I just saw 3.1.0 somewhere in your text. For 3.2.0 and SDK15.3.0, v3.40 of SES should be fine.

    for 3.2.0, this guide is the updated one, but it should be the same, just with new recommended settings, such as --sd-req 0x00AF.

     

    rmarques said:
    When intended for the device connected to serial it works, when intended for others it fails on the others, the problem is on the recovery of lost packets.

     What are the other nodes programmed with? Do they have the DFU example running? The reason I ask whether it is the DFU example, or something built on the serial example, SDK\examples\serial, is that this example works a bit different.

    How about the environment that you test in? Are the nodes close to one another? Did you change anything with regards to relay count? How many nodes do you use to test? Does the DFU fail on all devices, or only some?

  • I have two nodes side by side, both programmed with the DFU example built in debug mode, with a __LOG inside the nrf_mesh_dfu_rx function so I can inspect which DFU packets are being received using the RTT. The boards that I am using are two nRF52840 DKs with softdevice 6.1.1. DFU aborts on the node that is not connected to the computer.

Reply Children
Related