Hi all. Just as the title says, I am trying to generate a 1ms heartbeat timer on my XMC4500 hexagon board, but I am running into an error which you can see here: http://imgur.com/o5TGwms .
You can see there at the bottom in Build Output that I am getting the L6200E Error. Now, the reason it says .\Flash\Blinky.axf in front of the error is because I simply opened up the example Blinky project and deleted the contents of Source Files folder and replaced it with the sysTick.c code.
Any help is much appreciated.
Hi Zoran, instead of commenting on the error, I like to point you to our summary explaining how to generate a 1 ms interval with the "RTX Kernel Tick Timer Configuration" - please refer to: www.keil.com/.../_timer_tick.html
Beside, I don't know the version of MDK you are using. Comparing your example with my installation of MDK-ARM V5.14 and the latest versions of the corresponding Infineon::XMC4000_DFP 2.2.0, CMSIS 4.3.0 and Middleware 6.4.0 did not result in any error.
Kind regards, Ralf
R.Kopsch Senior Applications Engineer ARM Germany GmbH
Hi, R.Kopsch. When I Build the configuration code I get ERROR L6218E which you can see here: http://imgur.com/rv82eQS . What do you think the issue is?
Then I also tried to replace the Cortex-M interrupt vectors with OS_Tick_Handler. Here is the code in startup_XMC4500.s : gist.github.com/.../f42f76dd28648151dd09 . So what I did was simply replace lines 135-274 with the code for OS_Tick_Handler in your link; and I got many errors (26 errors).
What do you think I should do next?
You do realise that you can simply copy the text from the build output window and paste it here - don't you?
There is no need to mess about with screenshots and photo sharing sites...
Zoran,
I suggest that you are not changing files provided by Infineon.
The root of your problem is the two definitions of the SysTick_Handler. See here: http://www.keil.com/support/docs/3724.htm
Once you remove the RTX related files of your project the problem should disappear.
The questions that you raise are typical beginners questions and I recommend that you read the Getting Started Book that we provide.
For example www2.keil.com/.../mdk5-getting-started.pdf contains both a BLINKY with RTOS and a BLINKY without RTOS (where a SysTick_Handler is defined locally).
Hi, Reinhard. So I removed the RTX related files and I still get the same error, L6218E which you can see here: http://imgur.com/4VvkQjO . What do you think I should attempt next to solve this issue?
EDIT:
Or were you referring to my original code project. I just ran my original code and it succeeded with no errors. I get this debug perspective: http://imgur.com/ErfWGvx .
Is there a way I can check to see if my XMC4500 board really is generating a 1ms heartbeat timer?
EDIT 2:
Reinhard, also in the pdf you suggested I take a look at www2.keil.com/.../mdk5-getting-started.pdf on pages 24-25 there is source code for what looks like a 1ms SysTick timer, is this correct? So really, I can just use this code?
Toggle a GPIO at each tick an stick an oscilloscope on it?
Count a thousand, or some ticks, toggle an LED, and guestimate visually?
Read values from another free running timer source, and compare the counts. A timer clocking at 12MHz should see 12000 ticks in a millisecond. A 1 Hz RTC tick will see 1000 counts of a millisecond ticker. Etc.
Hi Pier. I will try some of your suggestions, but just looking at the code do you think it will generate a systick 1ms timer?
#include <stdio.h> #include <XMC4500.h> //SFR declarations of the selected device uint32_t msTicks = 0; /* Variable to store millisecond ticks */ void SysTick_Handler(void) { /* SysTick interrupt Handler. msTicks++; See startup file startup_XMC4500.s for SysTick vector */ } int main (void) { uint32_t returnCode; returnCode = SysTick_Config(SystemCoreClock / 1000); /* Configure SysTick to generate an interrupt every millisecond */ if (returnCode != 0) { /* Check return code for errors */ // Error Handling } while(1); }
It appears to be consistent, provided SystemCoreClock reflects reality.
I presume that's defined in system_arch.c, and reflects the source oscillator and/or PLL settings configured into the chip.
You're asking for a SysTick interrupt to occur 1/1000 of the CPU clock, ie 1 KHz or 1 ms
Here is system_XMC4500.c: gist.github.com/.../9d53320e88c9114a0d17
Here is startup_XMC4500.s: gist.github.com/.../bce8d21af5019e816f97
What are your thoughts now, Pier? Do you think I will be generating a 1ms systick timer?
I think you need to take some responsibility to test/evaluate this yourself. I haven't read the manual for your part, and don't have the board.
You are right, Pier. My next step would be to somehow test the board and see if I am truly generating a 1ms systick timer.
You mentioned several ways I can do this, but which way do you think would be the easiest/most efficient considering the board I am using?
With an oscilloscope or frequency counter.
Pier, I understand what you meant by turning on a GPIO at every 1ms tick, I am just having a hard time figuring out where in my current code to add the additional code to toggle the GPIO? How do you think I should approach this?