MicroCOSII problem

MicroCOSII problem

by Sylvain Jean-Roger Migaud -
Number of replies: 6

Hi, 

I want to do part 6 of the lab with MicroC OS II but I'm having an issue to run the example code.

I created a new project with eclipse for NIOS and used the MicroC OS template as i tried previously with the HelloWorld template and the code wasn't compiling (OS_TSK not define). With this template, the code is compiling and downloading on the FPGA but i don't get any message on the console.

The example code is using printf so i tried alt_putstr instead but it doesn't work either.

My NIOS on the FPGA is working because i can still download and run on it a my previous code not using MicroC OS II on it. Is there a special configuration necessary to run MicroC OS II on the NIOS (on plateform designer, cache size .... or a special configuration on eclipse or something to add to get the serial output ?)

Again,  I'm trying juste the exemple template so i think the code is correct.

I've been looking through the slides of the course but didn't found anything, is there a document describing the procedure to run MicroC OS II on the FPGA somewhere ?

Regards and thanks for your time and your help !

Sylvain


In reply to Sylvain Jean-Roger Migaud

Re: MicroCOSII problem

by Sahand Kashani-Akhavan -

Hi,

When you say you're using the example template, which one are you referring to? The only one I see on moodle is the very first one "PSOC_ES_RTES_standard_project_template_1.2.tar.gz"
https://moodlearchive.epfl.ch/2019-2020/mod/resource/view.php?id=924084

Is this the one you're referring to? If yes, that template just contains top-level design files, but no hardware as the user needs to do that. Can you describe what your qsys system looks like? Did you add a JTAG UART to your design? Without it you wouldn't be able to print.

Does anything other than printing work? For example, can you start two tasks and see if they are actually executing? Perhaps try toggling 2 different GPIOs in the tasks to confirm.

Or is no task starting at all?

In reply to Sahand Kashani-Akhavan

Re: MicroCOSII problem

by Sylvain Jean-Roger Migaud -

Hi,

I'm referring to this template offered when creating a new eclipse NIOS project

I also tried to put the code from the tutorial in a Hello World and a Hello World Small project but it wasn't working so i figured it was something wrong with the configuration of the project.

The Hello MicroC OS II default project generate a code with two simple tasks printing Hello and it's not working. I have the JTAG UART block in my hardware configuration

I also tried to put a "alt_printf(" test");" instead of the printf function used in the MicroC OS default code and it doesn't work either which makes me think that the programm doesn't work at all.

I don't have a logic analysis so it's a bit hard to see what's happening on a pin but I'll try to make a LED work to check.

Is there a specific configuration of the project (or template to use) to make MicroC OS work ?

Do you see something wrong with my hardware configuration (The fact that it works without MicroC OS makes me think it's correct).


Thanks for all your help,

Sylvain


In reply to Sylvain Jean-Roger Migaud

Re: MicroCOSII problem

by Sahand Kashani-Akhavan -

The software template in the IDE for MicroC/OS-II is just pure software, but I'm pretty sure you need some hardware in your system for it to work correctly. Do you have an Altera Timer in your system (not a custom one as I see in your Qsys module, but really the Altera one?) I believe the OS relies on it for tick generation.

In reply to Sahand Kashani-Akhavan

Re: MicroCOSII problem

by Sylvain Jean-Roger Migaud -

Hi,

Thanks for your answer, yes, i have the altera timer.

Here is my full configuration :


Do you see anything amiss ?

Also, you know if there's a guide somewhere in this course to setup Micro C OS II ?

I couldn't find a tutorial for that.

Thanks for your help,

Regards,

Sylvain

In reply to Sylvain Jean-Roger Migaud

Re: MicroCOSII problem

by Sahand Kashani-Akhavan -

Hi,

No, there is no tutorial to use microc as it usually works with the hardware used in the lab and the default template.

However, upon looking at your configuration, I see that the timer period is set to 1us. That is extremely low. Even commodity operating systems like linux have a timer set to 1ms, 1000x higher. Based on your measurements in the previous sections of the lab, you know that interrupt recovery time is higher than 1us, so I think your CPU in an eternal loop handling timer interrupts.

Try increasing the timer period to 1ms and see if that solves the issue.

In reply to Sahand Kashani-Akhavan

Re: MicroCOSII problem

by Sylvain Jean-Roger Migaud -

Hi, 

Thanks a lot, that was my issue, I put the timer on a 1ms period and that fixed it!

I put the 1us period because i wasn't sure what this timer was going to be used to and it is said in the lab that we are doing measurements down to the microsecond.

Thanks a lot anyway, i lost a lot of time on this issue trying lots of things.

Regards,

Sylvain