Error: Warning: L6320W: Ignoring --keep command. Cannot find argument 'os_cb_sections'. on nrf51-dk

16 Sep 2019

Hey I am using an nr51-dk, and whenever I download the mbed library, I get "Error: Warning: L6320W: Ignoring keep command. Cannot find argument 'os_cb_sections'. on nrf51-dk", and the code won't compile. I saw this forum post (https://os.mbed.com/questions/85360/Error-Warning-L6320W-ignoring-keep-comma/) on the subject, and the final comment outlines the same problem with the nrf51, but there is no solution.

I have tried going back to previous revisions of the libraries, and it gets rid of the errors, but I need some of the features of the newest version, so reverting to older version is no good for me.

Anyone know how to fix this?

17 Sep 2019

Hi Fabien,

Are you compiling a bare-metal project? If yes, then you can ignore the warning L6320W because the linker parameter --keep=os_cb_sections is for debugger usage.

In your case, the error is not cased by L6320W, 'W' here means warning, it notify you but doesn't stop you. So there should be other error message, would you check the log again? It might have an 'E' for error.

Regards, Desmond, team Mbed

17 Sep 2019

/media/uploads/fabfoodmarb/screenshot_mbed.png

As you can see in the picture, it is my only warning, but for some reason it is stopping the whole process.

18 Sep 2019

Hi Fabien,

Here is what I have when building bare-metal project, it shows L6320W, but the compilation still works. Could you give me a sample project and target that I can reproduce the problem here? Thanks.

/media/uploads/sayhuthut/bare-metal-success.jpg

18 Sep 2019

Hey, here is my main.cpp file, my target board is the nrf51-DK, and I am tying to use the standard mbed library.

/media/uploads/fabfoodmarb/main.cpp

19 Sep 2019

Hi Fabien,

Digging into this a while, found the root cause, it's not relevant with your code.

If you compile Mbed OS 2 project with mbed-cli on target NRF51_DK, you will see the link error undefined reference to `assert_nrf_callback'

That's because in Nordic SDK11, this callback is needed for ASSERT macro(don't know why...). So you have to define the callback in your main.cpp. Try adding below code snippet.

extern "C" void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name);
void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name)
{
    printf("nrf failure at %s:%d", p_file_name, line_num);
}

Let me know if you have any questions.

Regards, Desmond

19 Sep 2019

This worked perfectly, thank you so much for your help.