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

How to see debug messages via RTT channel without running it from debugger?

I am working on an existing Bootloader project, it uses the Bootloader from the SDK with added custom thin layer on top of it. It runs on a custom board.

I can see the debug messages fine when I run it from the debugger (SEGGER J-Link) - on RTT channel (using J-Link RTT Viewer).

However, when I let it run standalone (with debugger connected to the board), I can only see debug messages from our custom code. Once it jumps into Bootloader SDK component, there is no debug messages anymore.

Did I miss some configuration in sdk_config.h? Or something else?

Parents Reply Children
  • The UART bootloader is designed with HWFC. If you don't use HWFC you may need to change the baudrate to very low. Let's star with 9600bps. The reason is that there is some flash erasing involved when you do DFU. If you don't have HWFC there is a chance that your will have buffer overflow because the CPU is hang when there is flash activity on going. 

  • Hi Hung, sorry for the delayed response.

    I finally had a chance to try 9600 bps. I have a board that's consistently failed at the same spot. So, even with 9600 it's still failed. The failure is the embedded side didn't send the checksum ("CalcChecksum" no response). When I did a retry from the PC side (resend the command, 0x03), got mismatch checksum.

    Am I not supposed to do the retry?

    Any other idea I can try?

  • I don't have further idea except that you may need to run the bootloader in debug mode and check why it doesn't response to the CalcChecksum command. I suspect that it crashed earlier than that or it didn't receive the packet properly. 
    But could you confirm that you only see the issue in 3 boards and only one board always failed ? When you test the other 2 board at 9600 would they also failed ? 

  • Hi Hung, 9600 still failed on one board. The other two work, but I need to test more to check.

    The weird thing is, when it failed, the packet sequence is different, there are discrepancies. I used the same file, I don't understand why would the payload/sequence be any different, or why would it's parsed differently. It almost looks like the issue is in the file parsing.

    Here's what I meant:

    At the beginning:

    At the end:

    Let me know what you think.

  • Hi Harry, 

    Thanks for the trace. What I can see in the trace is that the main difference is the offset of 141 bytes in the Failed case. This showed that the bootloader already received the init packet and because of that the DFU master (I assume you are using nRFutil ? ) skip sending the init packet and simply execute it.

    After that the DFU master continue to transfer the image until it finish the first object and ask for CRC check. The failed board didn't response to the request and on the retry it responded with the CRC of the init packet (exactly the same as in the first response to the init packet Select command at the beginning). So for some reason the bootloader didn't accept the first object of the application image. 

    What I would suggest is to try to do a chip erase to clean the board and try again. Then you can record a trace with out the offset as in the current test. 

Related