FreeRTOS on mbed board with mbed Cloud IDE / Never ending story!

<Abstract>
   I have been trying to import the FreeRTOS into mbed board.
   Andy C guided us to do this with GCC as off-line compiler (Please see this forum thread)

   and I followed his suggestion and achieved to implement the FreeRTOS on the mbed board.
   In addition, I could run the FreeRTOS using LPCXpresso IDE environment (also off-line).
   Only remained part is that FreeRTOS runs on mbed board with mbed Cloud IDE (on-line compiler).
   I’m still in the way to try this and never achieve this until now.  "NEVER ENDING STORY" is here.
   I would like to show my progress at here and to get your advice to finalize my target.
   Thanks your suggestion and feedback in advance.

 

 

<Caution>
   Program here does NOT work!

 

           FreeRTOS_on_mbed_v1

   This is only for your reference.

 

<Target>

  • 1st Target: FreeRTOS runs with mbed Cloud IDE environment
  • 2nd Target: FreeRTOS runs with mbed libraries

 

 

<Implementation Strategy>
   There are some ways for a software development environment for mbed board.
   Here is my environment in Windows XP PC.

 
   Followings are problems for an implementation.

  1. The mbed Cloud IDE cannot support “Inline assembler”.
    Simon Ford, mbed staff explained the reason at here.
  2. The mbed Cloud IDE and Eclipse GCC IDE (LPCXpesso IDE) are using different C/C++ Compiler, RealView and GCC.

    Under this condition, I made following strategy.

  1.  Original source files have several “Inline-Assembler” code and “Macro with assembler code”. 
    ->  Those parts (from several files) combines into one file.
  2.  A C source file which creates above (1) is complied on Sourcery G++ Lite complier and output as an assembler source file.
  3.  A converted assembler file which creates above (2) and other FreeRTOS files are compiled on mbed Cloud complier.
    (As the fact, due to complier different between mbed Cloud and Sourcery G++ Lite, the assembler source file needs to modify most of the part.)
  4. In parallel, same files are complied on Sourcery G++ Lite complier and check operation condition on the mbed board.
    This action is very useful for checking the source files correctness.

 <Trial result>
   Base on above strategy, I did follows.

  1. Compiled all original FreeRTOS files on the mbed Could IDE to check error conditions and identify a portion of error.
  2. Found the root cause of error by “Inline Assembler” and “Macro with assembler code”.
    As a result, following files have above part in lines.
    a) port.c  b)queue.c  c)task.c  d)portmacro.h
  3. A file, port.c which has a lot of assembler codes separated two files.
    One is C source code part as port.c and another one is C with assembler code as port_asm.c.
  4. Moved source codes from above mention (2) files [b),c),d) 3 files] to port_asm.c
  5. Modified other C source files for no error condition
    (RealView, mbed Cloud IDE has severe error checking capability rather than GCC).
  6. Compiled port_asm.c file and created an assembler source file as port_asm_mbed.s file.
  7. This file, port_asm_mbed.s could NOT compile on the mbed Could IDE due to assembler language different with GCC.
    Modified for the file to pass the mbed Cloud assembler.
  8. Finally I have done all of procedure on the mbed Could IDE, compiling, linking and got a bin file. But it did NOT work!

   I need to understand current situation and find root cause for the trouble.
   Followings are current potential root causes.

 

  1. Interrupt handler
  2. Subroutine call problem from C source file to assembler file, port_asm_mbed.s
  3. Miss-modification port_asm_mbed.s
  4. Connection with “Start-up routine”
  5. Combination above (1) to (4)
  6. Other reason which I cannot identify until now

 <Reference>
   The program which is made by LPCXpresso IDE works well on the mbed board.
   You can download bin file from here (not in this page).
   The source files are zipped and saved as below (not in this page).

            http://www.page.sannet.ne.jp/kenjia/LPC1768_mbed_Xpresso_5.html#mbed_file
   This environment is LPCXpresso IDE.

 

   If you can understand Japanese, please visit my homepage as follows.
   http://www.page.sannet.ne.jp/kenjia/index.html


1 comment

30 Sep 2011

This is an extremely interesting project!

I'm just about to start dabbling with FreeRTOS on LPCXpresso.  I will try to follow your progress as I think it'd be most helpful to run FreeRTOS on mbed for certain things.

You need to log in to post a comment