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

printf() make something wrong

Hi ,I'm working on nrf_MESH v2.20 and nrf_SDK v15.0 and SESV3.40.

In the project of light_switch->proxy_client ,I use printf() to print something and it can work well and everything is OK.But after I pull out USB (for debugging ) the board can not work anymore.I have test it and I know that printf() in main(void) and in other functions ,for example, prov_provisionee_cb_link_established(prov_bearer_t * p_bearer) can cause different resoult.

It still work when I print something in main() after I pull out USB,but it doesn't work in other functions.And there is no information if I don't add printf() but it show the error when I use printf().

Also I remember I ever changed the codes about put_char() in SDKv15.0 because it isn't compatible with SES but  I don't think it is important for this trouble because I don't use uart.

So anyone have the same question and I need your help .

Thanks in advance.

Parents Reply
  • Thanks ,it works now though it still has an error report just as the picture above.

    I can find the _putchar() is defined in retarget.c but I don't use it or .h file.Is there some connection?

    And I have tried this file in ble_uart example,I find that if I define RETARGET_ENABLE as true and remove retarget.c it still works in debug mode but never run when not in debug mode (if RETARGET_ENABLE as failure my firmware will always run).

    I don't know why the program acts this way.

Children
Related