Running simple project with Softdevice and SDK 17.1.0

Hello,

I am developing a new application using nRF52832 and writing and debugging code on Segger embedded studio (Release 5.68) with SDK v17.1.0. 

I try to run simple application like the one below:

-------------------------

int main(void)

{

SEGGER_RTT_printf(0, "firmware started\n");

while(1)

{

 SEGGER_RTT_printf(0, "test\n");

nrf_delay_ms(1000);

}

}

--------------------

The application has been tested on both development kit board and my own board with same result. When I display RTT terminal, I get straigth away 7 messages "test" and then no more messages like if microcontroller when to sleep. 

I have two questions:

1) nrf_delay_ms doesn't operate correctly. I ahev already read some thread about this issue but none of what I read helped me. Any suggestions?

2) Is there any necessary code to keep awake micro in the main loop like idle_state_handle() function etc...

Thank you for your help

  • Hello,

    It may be that since you are printing the same thing over and over, it actually writes it again, but since the content of the buffer doesn't change, the RTT terminal doesn't realize it is a new log record. The RTT buffer is just an area in the RAM that the debugger continuously monitors. 

    Can you try the following:

    int main(void)
    {
        uint32_t dummy_counter = 0;
        SEGGER_RTT_printf(0, "firmware started\n");
        
        while(1)
        
        {
            
            SEGGER_RTT_printf(0, "test %d\n", dummy_counter);
            dummy_counter++;
            nrf_delay_ms(1000);
            
        }
    
    }

    and see if the behavior changes?

    Best regards,

    Edvin

  • Hi,

    thanks for the first reply. I tried your suggestion without success. 

    As stated in my initial message, application stops running and messages don't come as expected (with delay) but in one shot. 

    See below # of loop iterations before issue according to delay specified in nrf_delay_ms():

    100ms: # = 37

    500ms: # = 0

    1000ms: # = 3

    I am going to try with an older version of sdk and softdevice to compare behaviour

  • with SDK 15.0.0, I have no issue running the application. I will remain on this version for now.

  • Ok. That sounds weird. Do you think it is possible for me to reproduce what you are seeing? Is it possible to zip and upload the application folder? When you were working on SDK17, did you do any changes to any of the files outside the SDK folder? You could, for instance, try to extract a new copy of the SDK, and copy your application into this one to see if the behavior remains the same.

    Best regards,

    Edvin

  • Hi, I have moved a step forward. First of all, I got a nrf52832 dev kit and run simple blinky example using sdk 17.1.0 without any problems. I am now moving to my own custom board. 

    I have 1 LED (IO_13) and 3 test_pins (IO_29 to 31) I can easily use to start running simple project. Unfortunately, I have not been able to see any gpio toggling right now. 

    I have created my custom board, and modify simply blinky example to match with my board. I can run program step by step and can through assembly code, but none of the GPIOs toggle. 

    If you have any suggestions for my next steps, it would be helpful :-)

Related