Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

Not applicable
I'm studying electrical engineering with the major embedded systems. And for a school project we are using the XMC4500 Relax kit.
We want to use an RTOS, so we came by FreeRTOS.
But how we can put an RTOS on the Relax Kit? Know somebody an tutorial?
FreeRTOS have some demo applications, but these are for the Hexagon kit. Is it possible to run the demo's for the Hexagon also on the Relax kit? Or which adjustments are necessary to run them on a Relax Kit?

We want to use the SPI and the I2C communication protocol.

Thank you.
0 Likes
10 Replies
Travis
Employee
Employee
First like received
Hi generally you can run the demo FreeRTOS software for Hexboard on the Relaxkit. Please take note about the difference in IO mapping of the SPI and I2C on these 2 boards and make the necessary changes to it.
0 Likes
Travis
Employee
Employee
First like received
Please see the difference in the Communication mapping of the 2 boards.
0 Likes
Not applicable
Hi, I've tried to get FreeRTOS on the relax kit. This is the application I used. I only changed the pin for the LED and used the startupup_XMC4500.c/s from DAVE and not the one that came with the FreeRTOS demo. When I set CREATE_SIMPLE_BLINKY_DEMO_ONLY to 1. The application works. But when I set it to 0, it stops by "Insert_ExceptionHandler UsageFault_Handler". So what can do?

I've also tried to work with SPI and I2C, I use the DAVA Apps for this. SPI works, but with I2C I couldn't receive messages. I've maid a testboard with a DS1307 "real time clock chip" with I2C.

I can write data to it. But I couldn't received data. I've connect a logic analyzer to it. And then i see the received message, so the DS1307 sends a message to the micro-controller. But I couldn't find the message in my program. I also used the NVIC002 App for the interrupt.
What do I mis? I use p0.11 and p0.5.
A screenshot of the logic analyzer.
142.attach

code

#include

void receive_data_handler(void);

int main(void)
{

DAVE_Init();

// Configure message data length
I2C001_Type data1,data2,data3,data4,data5;

// Read access
// Transmission by the master with start condition,
// I2C write condition and slave address
data1.TDF_Type = I2C_TDF_MStart;
data1.Data = (0xD0 | I2C_WRITE);
I2C001_WriteData(&I2C001_Handle0,&data1);

// Write data to the device
data2.TDF_Type = I2C_TDF_MTxData;
data2.Data = 0x00;
I2C001_WriteData(&I2C001_Handle0,&data2);

// Transmit repeated start condition and slave address
data3.TDF_Type = I2C_TDF_MRStart;
data3.Data = 0xD0 | I2C_READ;
I2C001_WriteData(&I2C001_Handle0,&data3);

// Read one data from slave
data4.TDF_Type = I2C_TDF_MRxAck1;
data4.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data4);

// Stop condition by the master
data5.TDF_Type = I2C_TDF_MStop;
data5.Data = ubyteFF;
I2C001_WriteData(&I2C001_Handle0,&data5);

while(1)
{}
return 0;
}

// Event Handler( FIFO receive interrupt event) registered with NVIC002 App
void receive_data_handler(void)
{
uint16_t DataReceive1 = 0x0000;
// Read receive buffer, put the data in DataReceive1
I2C001_ReadData(&I2C001_Handle0,&DataReceive1);
IO004_TogglePin(IO004_Handle1);
}


edit:
I2C now also works. I forgot to assign the signal connection by I2C.

Now combine it with a RTOS / FreeRTOS. Any suggestions?
0 Likes
Not applicable
I actually managed to get FreeRTOS to run on the XMC4500 Relax Kit, I'll post a short instruction on how to set it up in DAVE3. It was actually pretty easy to do. All I had to do is use the startup_XMC4500c./.s and GPIO.h, which comes with Dave3. I used the same LED blink example of the Hexagon, only that I mapped the P3.9 to P1.1 and called P1_1_toggle using mainTOGGLE_LED(). There were some minor compile errors, which were relatively easy to fix. All the other peripheries I tried seemed to be working fine, since I use the same XMC4500.h and GPIO file, which was provided by Dave3.
0 Likes
Travis
Employee
Employee
First like received
Hi gabriel306,

Can you please share with us how you have FreeRTOS to run on the XMC4500 relax kit? We are very interested to know.:D
0 Likes
Not applicable
Hey Travis,

Here is freeRTOS example with blinking LED on Relax Kit.

Regards,
Bartosz
0 Likes
Not applicable
hi,

I downloaded the file from bkw20 and was able to compile it but every first time building after "clean project' I had 3 warnings:

c:/dave-3.1.10/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe:../RTOS.ld:61: warning: memory region `FLASH1_uncached' not declared
c:/dave-3.1.10/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe:../RTOS.ld:124: warning: memory region `DSRAM1_system' not declared
c:/dave-3.1.10/arm-gcc/bin/../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/bin/ld.exe:../RTOS.ld:161: warning: memory region `MEMORY_B1' not declared

second build the warnings are gone. Reason to worry about?

But when I tried to start the Debugger the following message showed up:
Loading failed: A problem occurred during downloading: memory at 0x0 was written to successfully, but the value read back does not match.

any ideas what could went wrong?

Regards,
Suckiden
0 Likes
Not applicable
Hi,

I've got the same problem as you, suckiden.
Did you solve it?

best regards
0 Likes
Not applicable
I've also got the same problem. Is there any way of recovering from this or do I have a dead board?
0 Likes
Not applicable
greet everybody. does anyone has an example of interrupt and freertos?
0 Likes