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

Assembly Programming With FreeRTOS

Posted by Joan Dunning on March 13, 2010
Does anyone have any experience or links to assembly programming with freertos?

I'm developing a BASIC compiler that generates assembly code, and I was wondering if it is possible to somehow link my assembly code with FreeRtos "C" code? I haven't looked too closely at the C code yet, I thought I'd just bounce the idea off people here first.

The goal would be for BASIC programmers to be able to use the features available in freertos for multitasking. If anyone knows if it is possible or has a link to a simple example of someone doing assembly programming / rtos then that would be a great start for me to get digging deeper into this.

My existing compiler supports procedures/functions/stack-frames and such, so maybe that will help with "mixing" the two different methods, I don't know, but VERY interested in trying this!!

RE: Assembly Programming With FreeRTOS

Posted by Richard Damon on March 13, 2010
Since a C compiler (at least internally) converts the C code to assembly, it should be possible. There are a few issues along the way to deal with. One is that if you are going to assume that the users of your BASIC compiler are not going to have a C compiler, then FreeRTOS will need to be provided already compiled as a object file, and the options configured with FreeRTOSConfig.h will need to be fixed ahead of time. Also, since FreeRTOS calls a few functions from the C run time library, you will need to distribute at least part of that (and may need to get permission depending on which C compiler you use). One other issue is that C code tends to require some startup code to be run at the beginning, the simplest way to do this in general is to make the "mainline" of the program a C function (main) and have that call your assembly function. Actually calling the FreeeRTOS is the easy part, as the C compiler should come with instructions on interfacing assembly to C.

All this assumes that you are able to distribute a linker to combine your code with FreeRTOS. If you use an open source C compiler, you should be able to distribute what you need.

RE: Assembly Programming With FreeRTOS

Posted by Richard on March 13, 2010
Keep in mind that I'm coming at this from a point of complete ignorance, but...

Presumably the BASIC interpreter is going to be resident on whatever which the BASIC program will be loaded. Is it possible to build FreeRTOS into the BASIC interpreter, then have FreeRTOS functions called through a jump table, in the same way that the ROMed versions of SafeRTOS work?

Regards.

RE: Assembly Programming With FreeRTOS

Posted by Joan Dunning on March 13, 2010
Thanks for that, it sounds like it's worth digging deeper..

Richard_Damon: I'll take a closer look at the C code and see what I need to build/link this...

RichardBarry: I'll have a look at SafeRTOS and the jump table, my BASIC system isn't interpreter based, its assembly code, but I think the principle should still apply.

I think I'll try a simple "hello world" example, just two assembly routines that toggle, really simple, and see what needs to be done to get these two routines "hooked in" to RTOS. From there I should be able to see how to widen the scope. It sounds like it's worth attempting so fingers crossed...

RE: Assembly Programming With FreeRTOS

Posted by Joan Dunning on March 13, 2010
Hi again,

I tried to download SafeRtos in order to evaluate the jump table principle but can't seem to find a download link for it? Maybe it's protected by license agreement, not sure, but would like to evaluate it, please help..

RE: Assembly Programming With FreeRTOS

Posted by Richard on March 13, 2010
Search for the StellarisWare package for the 9b96 (just search for 9B06) on this page: http://www.luminarymicro.com/products/software_updates.html . You will need to create an account to download it. The package contains a demo application (using lwIP I think) that runs on top of SafeRTOS. SafeRTOS itself is in the ROM of the LM3S9B96 so you will not find its source code, but you will find some header files (under "third party" of the files you download) that contain a jump table to allow you to link (sort of) with the RTOS code that is in ROM.

Regards.


[ 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