

IDE brings together almost all the steps required for developing C-code for RuuviTags, such as writing the code, compiling the code, flashing the code to RuuviTag and debugging the code as it is being run on RuuviTag. The RTT can be very useful in cases where you need the UART for other things than debugging, or in advanced applications where you can't afford to use the CPU to print messages using UART.Ĭontinue to Part 2: Setting up the PWM driver.Segger Embedded Studio (SES) is an Integrated Development Environment (IDE) for Nordic Semiconductor products, such as nRF52832 which is at the heart of RuuviTag. Start a debugging session and use SES's integrated Debug Terminal to see the debug information. The documentation for nrf_sdh_enable_request() tells us that we get error 8, NRF_ERROR_INVALID_STATE, because the SoftDevice is already enabled.ĭisable UART as backend by setting NRF_LOG_BACKEND_UART_ENABLED to 0 and instead turn on the RTT backend by setting NRF_LOG_BACKEND_RTT_ENABLED to 1. When you get errors like this, the first thing you should do is to go to and look up the documentation for the function that returned the error. Here you can see that we get error 8 in return when we call the function nrf_sdh_enable_request(). What happens now? You should get another error: Uint32_t err_code = nrf_sdh_enable_request() So try to add this code after the logging messages: APP_ERROR_CHECK(1234). Throughout the entire SDK you will see functions returning error codes and that these error codes can be checked with the macro called APP_ERROR_CHECK(error code). One more thing that is extensively used in the SDK, and something that goes hand in hand with the Logger Module, is the Error Module.
Segger embedded studio download error serial#
When you recompile the project you should see this in your serial terminal: We can change this by finding NRF_LOG_DEFAULT_LEVEL in sdk_config.h and set it to 4 (Debug). With this severity level only warnings, errors, and info messages are printed. Note how there seems to be a missing message! Why is there no message saying "This is a DEBUG message."? It is missing because the default severity level is set to "info" in sdk_config.h. Now you should see this output on your terminal: NRF_LOG_WARNING( "This is a WARNING message. TODO PART 1: Test out NRF_LOG module NRF_LOG_ERROR( "This is an ERROR message. You can do this by modifying the DEVICE_NAME define in main.c: You might want to make the advertising name more unique to help recognize your device. Your device should show up in the device list: Open up nRF Connect for Mobile and start scanning. This indicates that the application is running, and that the device is advertising. You should now see that LED1 on the nRF52840 DK is blinking periodically. This will program both the SoftDevice and the application code to your nRF52840 DK. Click 'Target->Download " name of project"'. When the build finishes, notice how SES shows you how much Flash and RAM is being used by your application (the output window says we are using 192 KB of flash, but note that this includes the S140 SoftDevice which is 152 kB alone). To build your project, click 'Build->Build " name of project"' (or click F7 on windows).
