Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

STR912 issue (eclipse + gcc + hitex)

Posted by christophe on December 4, 2007
Hello everybody,

I have trouble in using SRT912 and FreeRTOS. I am using the STR9 USB stick coming from Hitex. Normally, it should be quite straightforward to run freeRTOS on the stick due to the already existing port for the STR912 dev board on IAR dev tools. But for me it doesn’t.

The Hitex USB stick is coming with the GNU cross-compiler and the hitex IDE and debugger. Due to some stability issues in using the Hitex tools. I am not sure to still use the Hitex debugger in the future. For this reason, i try to set up my configuration right now using eclipse + mingw make + gnu compiler provide by hitex. For sure I still use Hitex debugger to flash and make bug tracking.

I have rewritten the asm file of the STR912 demo from IAR asm to GNU asm. And wrote a make file with an application which do nothing except launching the idle task. I was hopping to be able see this task running alone.
To avoid ARM-thumb switching issue all the code is compiled for ARM code today.

Stepping in my application seems to be OK until vTaskStartScheduler()->xPortStartScheduler()->vPortStartFirstTask();

As it has been designed this function is just a call to the macro portRESTORE_CONTEXT
At the end of this macro, just before jumping, every thing seems to be OK...
the registers are correctly initialized (R1=0101..., R2=0202... and so on)
The LR register has the address of the idle task + 4...
We are in supervisor mode...
But stepping the "subs" instruction is issuing an Undefined instruction exception. I do not understand why.

If someone has already faced with this problem I greatly seek its support.


Regards,
Christophe

RE: STR912 issue (eclipse + gcc + hitex)

Posted by Dave on December 5, 2007
It sounds like you have everything in the expected state. Particularly the Supervisor mode, I thought this was going to be your problem until I got to the bottom of your email.

Can you check that you don't have THUMB_INTERWORK defined in your makefile (as -DTHUMB_INTERWORK). Also, is the address in the LR on a four byte boundary?

RE: STR912 issue (eclipse + gcc + hitex)

Posted by christophe on December 5, 2007
Thanks Dave for your message!

i have double checked. i am sure that :
- i am in supervisor mode,
- i am not using the THUMB_INTERWORK define
- the address in the LR register is clearly on a 4 byte boundary and this address is the prvIdleTask function + 4

I have made several searches on this forum and on the web. i have seen that there is a pending issue on GCC compiler which gives unsafe behaviour to the portSAVE_CONTEXT function. but i think (maybe i am wrong) that my problem is not in relation with this issue.

To be sure i have transformed the C definition portSAVE_CONTEXT portRESTORE_CONTEXT into assembleur macro. This will avoid the compiler to perform unsafe coding.
the opcode i have on my debugger is exactly the one written in the macro file

I still searching...

Regards,
Christophe


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists