Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


H8-38024 Port

Posted by Luca Bassanello on November 30, 2007

I'm trying to make a port of FreeRTOS to a
Renesas H8-38024 microcontroller (H8-300L core)

There are two links of my stuff:

The code above seems to works (1 task only LedRun flash), but
when in my main application (handler.c), I add a second task
to flash a second led (LedFault), the microcontroller hangs.

The datasheet of that microcontroller is easly downloadable from:

My current version of the port (port.c,portmacro.h) is based on
R.Barry H8/S2329 port.

Can someone tell me what is wrong in my code ?

Thank you in advance,

RE: H8-38024 Port

Posted by Richard on December 2, 2007
Are there any differences in the core between the 38024 and 2329? That is, are the number, size and meaning of the registers the same? The other thing that will effect success is the timer being used to generate the RTOS tick - is this the same between the two?

If everything is the same then it should just be a matter of ensuring the memory map is set correctly for the linker, and maybe adjusting the heap size.


RE: H8-38024 Port

Posted by Luca Bassanello on December 2, 2007
The 38024 uses H8-300 core, the 2329 uses H8S core. It is different, the first has
16bit register, the second 32bit. The number of registers are the same. The Tick ISR
was writed from scratch but i've tested it without freertos, same as memory map of
the linker. I think I've changed port.c portmacro.h following along with the datasheet.

Like I said, 1 task seems to run correcly, 2 tasks hangs the microcontroller, and sadly
I don't know what is wrong ...

Thanks for the support,

RE: H8-38024 Port

Posted by Richard on December 2, 2007
So this is quite a different port then. I cannot go through your code or datasheet as this will take a couple of days (I can send you a quote for the work if you like :o), but below are my suggestions for testing the new port.

I would suggest writing a task that fills the registers with known values (using inline asm), then calls taskYIELD(), then checks that all the registers still contain their known values (again using inline asm) - the registers should not have been altered across the call to taskYIELD(). Run this task with configUSE_PREEMPTION set to 0.

Once you have a single task running this way, create another task that does the same thing, but fills the registers with different values and run both tasks at once. When both tasks are running you should have something like this:

1) Task A fills registers with known values and yields to task 2.
2) During the yield the Task A values are stored to the Task A context.
3) Task B runns and fills registers with different values, overwriting those filled by Task A.
4) Task B yields back to Task A.
5) During the yield, that Task B values are saved to the Task B context, and the Task A values are restored from the Task A context back into the registers.
6) Task A checks the registers hold the values it expects, flagging an error if not.
7) etc. etc.

Once you have both tasks running correct in this cooperative way, take out the call to task taskYIELD() and set the configUSE_PREEMPTION to 1, and check no errors are found when running preemptively.


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

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner