ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.34k stars 1.08k forks source link

failing to initialize oskernelInitialize() correctly #386

Closed zawbaz closed 5 years ago

zawbaz commented 6 years ago

I am using CMSIS RTX RTOS2 libraries on apollo2mcu cortex-m4f in DS5. The return value of osKernelInitialize() appears as osError. When the function SVC0_0 (KernelInitialize, osStatus_t) is called inside rtx_kernel.c , the link register gets the value of some reserved region and SVC_Handler is called and osKernelInitialze() returns always osError. Any help would be highly appreciated in this regard

JonatanAntoni commented 6 years ago

Hi @zawbaz,

thanks for getting in touch. The misbehavior you describe sounds like a fundamental issue to me.

Cheers, Jonatan

zawbaz commented 6 years ago

Hi Jonathan, Thanks a lot for your reply. Yes the link register contains 0xFFFF FFE9, i thought this is the wrong value . But you clarified it that it is the magic value . Yesterday I tried with the optimization level Restricted (-01) on DS5 then the kernel is Initialized and thread is also created successfully . But on optimization level Minimum (-O0) , osKernelInitialze() is gving status of osError . With the optimization level Restricted (-01), osKernelInitialze() , osThreadNew(app_main, NULL, NULL) and osKernelStart() are working fine but sometimes the gdb shows No source available for "(gdb[59].proc[42000].threadGroup[i1],gdb[59].proc[42000].OSthread[1]).thread[1].frame[0]" or No source available for "0x0"
I have not tried CMSIS-RTOS2 Blinky (uVision Simulator) because i am using DS5.

Regards, Faisal

JonatanAntoni commented 6 years ago

Hi @zawbaz, can you provide a stripped-down minimal example reproducing your issue, please? There are many details that could cause such issues. Hard to tell without knowing them all, e.g. compiler version, compiler and linker flags, interrupt and rtos configuration, aso.

Cheers, Jonatan

zawbaz commented 6 years ago

Dear Jonathan, I am using ARM Compiler 5 (DS-5 builtin) and the default settings of RTX_Config.h of RTX RTOS2. main.c template file of CMSIS-RTOS2 in Apollo2mcu has been used. The isr names in startup.s file of apollo2 mcu have been modified according to irq_cm4f.s. This is the compiler options --cpu=Cortex-M4.fp.sp --apcs=/hardfp --thumb --littleend -DRTE -DAPOLLO2_1024 Debugging is being performed through GDB-Segger J-Link Debugging in DS5 I am facing no issue in Keil Uvision. If you require other information,please let me know

Regards, Faisal

JonatanAntoni commented 6 years ago

Hi Faisal,

Now its getting strange. Did you raise this issue at the DS-5 support, too?

You could try to compare the MDK compiler options with the ones in DS-5. What happens if you use the binary from MDK and debug it with DS-5? And vice versa?

Can you provide the projects?

Cheers, Jonatan

zawbaz commented 6 years ago

Hi Jonatan,
Yes I will ask DS-5 support too. But I think it can be the problem of GDB client or server or GNU Mcu eclipse plug in . Because i m using the gnu mcu eclipse plugin for jlink debugger. I will try also other method as you suggested .

Regards, Faisal

JonatanAntoni commented 5 years ago

@zawbaz, anything new about this? Has your issue been solved in the meanwhile? Consider providing further information or closing the issue, please.