2020-08-07 10:42 AM
I am working on porting Mynewt RTOS on nucleo-l55ze (Cortex-m33) board,and able to build blinky and load.but led will blink only once and observed the issue that is unhandled interrupt/exception generated while context switching between main task to idle task,that's why proper execution is not happening.
Steps :-
1.Execution of while function in main.c works fine for one time
2.But when when context switched to os_idle_task it get proper address and control goes to os_idle_task at that time
os_idle_task(void *arg)
{
801086c: b5f8 push {r3, r4, r5, r6, r7, lr}
os_time_t sanity_itvl_ticks;
sanity_itvl_ticks = (MYNEWT_VAL(SANITY_INTERVAL) * OS_TICKS_PER_SEC) / 1000;
sanity_last = 0;
hal_watchdog_tickle();
801086e: f002 f879 bl 8012964 <hal_watchdog_tickle>
;;;
this instruction execute and code crash.
3.after crashing control moves to Default IRQ
TST LR,#4
ITE EQ
MRSEQ R3,MSP
MRSNE R3,PSP
PUSH {R3-R11,LR}
MOV R0, SP
BL os_default_irq
Register values before crash :
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x200006b0 536872624
r5 0x2000066c 536872556
r6 0x20000260 536871520
r7 0x801086d 134285421
r8 0xffffffff -1
r9 0x100 256
r10 0xffffffff -1
r11 0xffffffff -1
r12 0xdeadbeef -559038737
sp 0x200006b0 0x200006b0 <g_os_idle_ctr>
lr 0x80112ff 134288127
pc 0x801086c 0x801086c <os_idle_task>
xPSR 0x1000000 16777216
msp 0x20017fe8 0x20017fe8
psp 0x200006b0 0x200006b0 <g_os_idle_ctr>
Register values after crash:
r0 0x0 0
r1 0x0 0
r2 0x0 0
r3 0x0 0
r4 0x200006b0 536872624
r5 0x2000066c 536872556
r6 0x20000260 536871520
r7 0x801086d 134285421
r8 0xffffffff -1
r9 0x100 256
r10 0xffffffff -1
r11 0xffffffff -1
r12 0xdeadbeef -559038737
sp 0x20017fe8 0x20017fe8
lr 0xffffffbc -68
pc 0x8011812 0x8011812 <os_default_irq_asm>
xPSR 0x1000003 16777219
msp 0x20017fe8 0x20017fe8
psp 0x200006b0 0x200006b0 <g_os_idle_ctr>
Compiler setting:
compiler.flags.base: -mcpu=cortex-m33+nodsp -mthumb-interwork -mthumb -Wall -Werror -fno-exceptions -ffunction-sections -fdata-sections -fno-common