Open wparkermackenzie opened 6 years ago
mbed_app.json
.Build with the debug profile in /profiles
. You cannot use the normal Mbed OS build profiles as they are too big.
$ mbed compile --profile=./profiles/debug.json
After this you can link the application with debug spec.
Thank you, that was the clue I needed. Unfortunately, when running in this way, the application does not get very far as there seems to be a problem with the timers. On the terminal is an indication of a Timer error after attempting to initialize the radio, while the application spins in mbed_die() blinking whats seems to be SOS on the main LED. I am digging in; however, any thoughts or suggestions would be most welcome.
Hello from application version 27
[INFO] Initialize radio...
Timer 0x20004888 error -3: Resource not available
^C
Program received signal SIGINT, Interrupt.
0x08010950 in wait_us (us=150000) at ./mbed-os/platform/mbed_wait_api_rtos.cpp:43
43 while ((us_ticker_read() - start) < (uint32_t)us);
(gdb) bt
#0 0x08010950 in wait_us (us=150000) at ./mbed-os/platform/mbed_wait_api_rtos.cpp:43
#1 0x080108f6 in wait_ms (ms=150) at ./mbed-os/platform/mbed_wait_api_rtos.cpp:31
#2 0x0800fb2e in mbed_die () at ./mbed-os/platform/mbed_board.c:40
#3 0x08010598 in _exit (return_code=1) at ./mbed-os/platform/mbed_retarget.cpp:778
#4 0x080105bc in __wrap_exit (return_code=1) at ./mbed-os/platform/mbed_retarget.cpp:829
#5 0x0800fde6 in error (format=0x8033bdc "Timer %p error %i: %s\r\n") at ./mbed-os/platform/mbed_error.c:42
#6 0x08011042 in EvrRtxTimerError (timer_id=0x20004888, status=-3) at ./mbed-os/rtos/TARGET_CORTEX/mbed_rtx_handlers.c:114
#7 0x0801527a in svcRtxTimerStop (timer_id=0x20004888) at ./mbed-os/rtos/TARGET_CORTEX/rtx5/rtx_timer.c:281
#8 0x08011134 in SVC_Handler ()
mbed compile -m xdot_l151cc -t GCC_ARM --profile=./profiles/debug.json
openocd -f /usr/share/openocd/scripts/interface/cmsis-dap.cfg -f /usr/share/openocd/scripts/target/stm32l1.cfg
arm-none-eabi-gdb ./lorawan-fota-demo.elf
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000000 in ?? ()
(gdb) b main
Breakpoint 1 at 0x802238c: file ./src/main.cpp, line 329.
(gdb) monitor reset init
adapter speed: 300 kHz
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08015948 msp: 0x20008000
STM32L: Enabling HSI
adapter speed: 2000 kHz
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-only addresses.
Breakpoint 1, main () at ./src/main.cpp:329 329 printf("Hello from application version %d\n", APP_VERSION); (gdb) list 324 void blink() { 325 led = !led; 326 } 327 328 int main() { 329 printf("Hello from application version %d\n", APP_VERSION); (gdb) c Continuing. ^C Program received signal SIGINT, Interrupt. 0x08010952 in wait_us (us=400000) at ./mbed-os/platform/mbed_wait_api_rtos.cpp:43 43 while ((us_ticker_read() - start) < (uint32_t)us); (gdb) bt
So I think we're running out of memory in debug configuration and that's why not all peripherals can be initialized... Maybe upping stack size on the main thread works but we're already pretty memory limited. I could have some time later this week to examine.
The code stops functioning with the call to lora::Mote::Mote(lora::Settings*, lora::ChannelPlan*)
in the object library provided by Multitech with the US915 channel plan; someplace after the 2nd call to new. The last call to the malloc wrapper observed the memory utilization to be as follows:
{current_size = 9266, max_size = 9266, total_size = 9266, reserved_size = 0, alloc_cnt = 10, alloc_fail_cnt = 0}
However, while in the panic mbed_die the heap_stats are observed to be reset back to 0.
{current_size = 0, max_size = 0, total_size = 0, reserved_size = 0, alloc_cnt = 0, alloc_fail_cnt = 0}
Hello, What is your strategy for on chip debugging with the LTEK FF1705? The build fails when I specify the debug profile. Thank you in advance, Parker