Debugging firmware with segger embedded studio


#1

Hi There,

I would like to modify the weather station demo firmware with segger embedded studio. Does anyone have the firmware bundled as a segger embedded studio solution that they could share?

It would save a lot of hasstle getting the codebase configered properly.


#2

At least one of our members on Slack channel is building code with SEG, you can ask around in there


#3

I’ve got one - just getting it into the right state to share. Could be today.


#4

It’s going to take me another few hours (across a hopefully-very-small-number-of-days) to get ses+SDK12.3 up. (I forgot I was using my own code in ses with SDK14.2.)


#5

Many thanks, I really appreciate it.


#6

This is taking longer than I expected. The nfc .a file expects certain symbols. I tried the quick-and-dirty route of removing nfc, but still have some issues getting all the right symbols in place. It’s going to be at least a few days before I can revisit this.


#7

Thats ok. I appreciate your help. I’m sure this will be very helpful for a number of people. Thanks again.


#8

To me for example. Looking forward to a solution to code and debug with Segger Studio.

Thanks a lot!


#9

Hello, any update on this issue? Whatever help on configuring Segger for Windows and running the official firmware is very welcome.

The progress I´ve made on this is as follows:

Preprocessor Definitions:
NRF52
NRF52832
SOFTDEVICE_PRESENT
S132
BOARD_CUSTOM
BOARD_RUUVITAG_B

User Include Directories:
.
C:\Ruuvi\ruuvitag_fw-master\bsp
C:\Ruuvi\ruuvitag_fw-master\drivers\battery
C:\Ruuvi\ruuvitag_fw-master\drivers\bluetooth
C:\Ruuvi\ruuvitag_fw-master\drivers\bme280
C:\Ruuvi\ruuvitag_fw-master\drivers\init
C:\Ruuvi\ruuvitag_fw-master\drivers\lis2dh12
C:\Ruuvi\ruuvitag_fw-master\drivers\nrf_nordic_nfc
C:\Ruuvi\ruuvitag_fw-master\drivers\nrf_nordic_pininterrupt
C:\Ruuvi\ruuvitag_fw-master\drivers\nrf_nordic_watchdog
C:\Ruuvi\ruuvitag_fw-master\drivers\pwm
C:\Ruuvi\ruuvitag_fw-master\drivers\rng
C:\Ruuvi\ruuvitag_fw-master\drivers\rtc
C:\Ruuvi\ruuvitag_fw-master\drivers\spi
C:\Ruuvi\ruuvitag_fw-master\libraries\base64
C:\Ruuvi\ruuvitag_fw-master\libraries\base91
C:\Ruuvi\ruuvitag_fw-master\libraries\data_structures
C:\Ruuvi\ruuvitag_fw-master\libraries\dsp
C:\Ruuvi\ruuvitag_fw-master\libraries\rust_allocator
C:\Ruuvi\ruuvitag_fw-master\libraries\ruuvi_sensor_formats
C:\Ruuvi\ruuvitag_fw-master\ruuvi_examples\ruuvi_firmware\ruuvitag_b\s132\config
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\ble\common
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\ble\ble_advertising
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\clock
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\common
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\delay
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\device
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\hal
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\gpiote
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\drivers_nrf\timer
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\button
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\log\src
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\scheduler
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\timer
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\util
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\softdevice\common\softdevice_handler
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\libraries\log
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\softdevice\s132\headers
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\toolchain\cmsis\include
C:\Nordic_Semi\nRF5_SDK_12.3.0_d7731ad\components\toolchain

Register Definition File:
C:/Nordic_Semi/nRF5_SDK_12.3.0_d7731ad/svd/nrf52.svd

Additional Load File [0]
C:/Nordic_Semi/nRF5_SDK_12.3.0_d7731ad/components/softdevice/s132/hex/s132_nrf52_3.0.0_softdevice.hex

An the error message on building the code is as below. It appears to me the libraries under the C:\Ruuvi folder are not being compiled during build process.

Rebuilding ‘R4’ from solution ‘R4’ in configuration ‘Debug’
Compiling ‘main.c’
Compiling ‘SEGGER_RTT_Syscalls_SES.c’
Compiling ‘SEGGER_RTT.c’
Assembling ‘thumb_crt0.s’
Assembling ‘Cortex_M_Startup.s’
Assembling ‘HardFaultHandler.S’
Compiling ‘SEGGER_HardFaultHandler.c’
Generating linker script ‘R4.ld’
Linking R4.elf
Output/R4 Debug/Obj/main.o: In function nrf_delay_us': undefined reference toSystemCoreClock’
Output/R4 Debug/Obj/main.o: In function change_mode': undefined reference tomillis’
undefined reference to millis' undefined reference tolis2dh12_set_sample_rate’
undefined reference to app_timer_stop' undefined reference toapp_timer_start’
undefined reference to bluetooth_configure_advertising_interval' undefined reference tobluetooth_apply_configuration’
undefined reference to lis2dh12_set_sample_rate' undefined reference toapp_timer_stop’
undefined reference to app_timer_start' undefined reference tobluetooth_configure_advertising_interval’
undefined reference to bluetooth_apply_configuration' Output/R4 Debug/Obj/main.o: In functionbutton_press_handler’:
undefined reference to app_sched_event_put' Output/R4 Debug/Obj/main.o: In functionpower_manage’:
undefined reference to app_error_handler' Output/R4 Debug/Obj/main.o: In functionupdateAdvertisement’:
undefined reference to bluetooth_set_manufacturer_data' undefined reference tobluetooth_set_eddystone_url’
Output/R4 Debug/Obj/main.o: In function main_timer_handler': undefined reference tobme280_read_measurements’
undefined reference to bme280_get_temperature' undefined reference tobme280_get_pressure’
undefined reference to bme280_get_humidity' undefined reference tolis2dh12_read_samples’
undefined reference to getBattery' undefined reference toparseSensorData’
undefined reference to encodeToRawFormat5' undefined reference toencodeToUrlDataFromat’
undefined reference to watchdog_feed' Output/R4 Debug/Obj/main.o: In functionmain’:
undefined reference to init_sensors' undefined reference toinit_log’
undefined reference to init_leds' undefined reference toinit_nfc’
undefined reference to init_ble' undefined reference tobluetooth_advertising_stop’
undefined reference to bluetooth_tx_power_set' undefined reference tobluetooth_configure_advertising_interval’
undefined reference to init_timer' undefined reference toinit_rtc’
undefined reference to pin_interrupt_init' undefined reference topin_interrupt_enable’
undefined reference to pin_interrupt_enable' undefined reference tolis2dh12_reset’
undefined reference to lis2dh12_enable' undefined reference tolis2dh12_set_scale’
undefined reference to lis2dh12_set_sample_rate' undefined reference tolis2dh12_set_resolution’
undefined reference to lis2dh12_write_register' undefined reference tolis2dh12_write_register’
undefined reference to lis2dh12_write_register' undefined reference topin_interrupt_enable’
undefined reference to lis2dh12_set_interrupts' undefined reference tobme280_set_oversampling_hum’
undefined reference to bme280_set_oversampling_temp' undefined reference tobme280_set_oversampling_press’
undefined reference to bme280_set_iir' undefined reference tobme280_set_interval’
undefined reference to bme280_set_mode' undefined reference toinit_blink_status’
undefined reference to init_watchdog' undefined reference tobluetooth_advertising_start’
undefined reference to app_sched_execute' undefined reference tolis2dh12_int1_handler’
Build failed

Any help is appreciated.

thanks.


#10

Looks like that the ruuvi .c files are not getting compiled


#11

I have the same impression, but could not find the root cause. Both .h and .c files of the Ruuvi supplied code are on the same folders and the directive that points them out to the IDE are declared on “User Include Directories”. Any hint?

Thanks.