December 8, 2014 07:24
Over the last weeks, several contributions, extensions and fixes have been added to the McuOnEclipse components, so a new release is available on SourceForge.
With a RingBuffer buffer size of 256 it was possible that the internal index variable overflows. This has now been fixed and it works properly with a buffer size of 256 bytes.
With FreeRTOS v8.0.0 on, there is an issue with gcc+gdb that it does not properly show the stack frame:
This is caused by the addition of an error handler in case the task returns. There is now a setting in the FreeRTOS properties where you can disable the error handler:
With this, the stack task frames are shown properly with GDB too:
If using a watchdog and if command line Shell commands take long for printing text, this can be an issue to properly refresh a watchdog. To deal with this situation, two optional hooks have been added to the shell:
If enabled, the hooks are called before and after parsing a command:
uint8_t CLS1_IterateTable(const uint8_t *cmd, bool *handled, CLS1_ConstStdIOType *io, CLS1_ConstParseCommandCallback *parserTable) { uint8_t res = ERR_OK; if (parserTable==NULL) { /* no table??? */ return ERR_FAILED; } /* iterate through all parser functions in table */ while(*parserTable!=NULL) { CLS1_OnBeforeIterateCmd(cmd); if ((*parserTable)(cmd, handled, io)!=ERR_OK) { res = ERR_FAILED; } CLS1_OnAfterIterateCmd(cmd); parserTable++; } return res; }That way I can measure and offset the time needed to handle a command and use this in my application to keep my watchdog counters up-to-date:
static TickType_t ticksBeforeCmd; void SHELL_OnBeforeIterateCmd(const uint8_t *cmd) { (void)cmd; /* not used */ ticksBeforeCmd = FRTOS1_xTaskGetTickCount(); } void SHELL_OnAfterIterateCmd(const uint8_t *cmd) { (void)cmd; /* not used */ WDT_IncTaskCntr(WDT_TASK_ID_SHELL, (FRTOS1_xTaskGetTickCount()-ticksBeforeCmd)/portTICK_RATE_MS); /* count for output to console */ }FreeRTOS PercepioTrace
Additional properties in Percepio FreeRTOS trace gives now more control what to trace:
A new function has been added to the Utility to scan a string in double quotes. This is useful for example to read strings like
"hello", "my world"
The LCDHTA character LCD component has now a public interface to WriteLCDCommand() so the application can directly write LCD commands. And there are two new functions to shift the cursor either left or right:
The following devices have been added to the USB stack component:
The RNet component has been extended with a shell interface for the RMSG part, so it can report the size and status of the message queues. Additionally error handling for queue full cases in the nRF24L01+ transceiver has been improved.
This component is a contribution of Omar Isaí Pinales Ayala from Mexico (thanks!). Omar already contributed a OneWire component which is experimental for the moment.
With the FreeRTOS_Tasks component new tasks can be created with a graphical user interface:
It then creates the source to create the tasks:
void TSK1_CreateTasks(void) { if (FRTOS1_xTaskCreate( BlinkTask, /* pointer to the task */ "Blink", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE + 0, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY + 0, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } if (FRTOS1_xTaskCreate( CalcTask, /* pointer to the task */ "Calc", /* task name for kernel awareness debugging */ configMINIMAL_STACK_SIZE + 100, /* task stack size */ (void*)NULL, /* optional task startup argument */ tskIDLE_PRIORITY + 2, /* initial priority */ (xTaskHandle*)NULL /* optional task handle to create */ ) != pdPASS) { /*lint -e527 */ for(;;){}; /* error! probably out of memory */ /*lint +e527 */ } }Summary
I’m happy to publish multiple extensions, improvements and as well bug fixes. I hope the release is useful. The full release notes are available on SourceForge here.
Happy Upgrading 🙂
Posted by Erich Styger
Categories: CDE, Component Release, Eclipse, Embedded Components, FreeRTOS, Processor Expert, SourceForge
Tags: Eclipse, Embedded Component, FreeRTOS, Freescale, Processor Expert, software, software project, SourceForge, technology
16 Responses to “McuOnEclipse Components: 07-Dec-2014 Release”
Leave a Reply
Mobile Site | Full Site
Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.
Sounds great! I’m especially interested in the string processing functions. Where can I download these component libraries and how do I import these into Code Warrior? I tried to find it on mcuoneclipse, without succeeding, though. A short hint would be appreciated.
Thanks and cheers
Adrian
LikeLike
By Adrian on December 8, 2014 at 13:36
Hi Adrian,
see https://mcuoneclipse.com/2014/10/21/mcuoneclipse-releases-on-sourceforge/
Erich
LikeLike
By Erich Styger on December 8, 2014 at 13:49
Hi,
how to create simple multi task without the use of operating system?
ARM Kinets.
ex:
main_task(){}
serial_task(){}
thanks
Carlos.
LikeLike
By Carlos on December 9, 2014 at 01:10
Hi Carlos,
This is the natural domain of operating systems :-). But you could use the Trigger component of my McuOnEclipse processor expert component set. With this, you have ‘mini-tasks’ which probably would do what you need?
LikeLike
By Erich Styger on December 9, 2014 at 08:19
Hi Erich,
my case 2 task
example:
main_task1 = monitor ( CDC ) PC ARM
load_code for RAM ( task2)
——————————————————
task2_RAM_Execute( code in RAM ) exe
——————————————————-
task1 load code(exe) PC,
task2 running code in ram.
thanks,
Carlos.
LikeLike
By Carlos on December 9, 2014 at 12:18
That looks like you should use a light-weight kernel like FreeRTOS….
LikeLike
By Erich Styger on December 9, 2014 at 16:17
Hi Erich,
with h08 was very easy to create multi tasks.
I will see,
thanks,
Carlos.
LikeLike
By Carlos on December 9, 2014 at 21:14
Hi Carlos,
then why you cannot use the same approach for Kinetis then?
Erich
LikeLike
By Erich Styger on December 10, 2014 at 05:41
Hi Erich,
See:
asm51.eng.br/forum/topic.asp?TOPIC_ID=10809
my examples, simple task for HC08,
timer_owerflow = sw task
I am new to ARM, my knowledge is not enough to do the same code.
thanks,
Carlos.
LikeLike
By Carlos on December 10, 2014 at 12:47
Hi Carlos,
looks like this is simply using a timer interrupt and then depending on the timer count to call functions. You can easily do this for ARM too, but you do not need assembly: simply write that in C code.
LikeLike
By Erich Styger on December 10, 2014 at 14:04
Why am I getting “conflicting types for ‘boolean'” when using MQX Lite and USB CDC class device?
LikeLike
By henry on December 10, 2014 at 20:30
Probably because MQXlite is declaring its own version of boolean?
LikeLike
By Erich Styger on December 10, 2014 at 21:02
thanks, I have solved it, I move USB to lastet component, and then ok
LikeLike
By henry on December 12, 2014 at 22:37
Hi Erich,
I created a project only with a KL05Z32 CPU in KDS using Processor Expert to test the Wait component. In main I used this:
Bit1_PutVal(TRUE);
WAIT1_Waitms(3);
Bit1_PutVal(FALSE);
WAIT1_Waitus(50);
Bit1_PutVal(TRUE);
WAIT1_Waitns(1);
Bit1_PutVal(FALSE);
WAIT1_Waitns(1000);
Using a scope I saw that the times are little different.
the 3ms is 3,28ms
50us is 58,8us
1ns is 1,84us
1000ns is 4,4us
CPU is configured to FEI mode, 20,97152MHz and the slow internal reference is used.
Did I missconfigured something or the reference’s accuracy is not so good? Is this component useful for KL05Z32 devices?
The 1ns I now that is not possible due to this 20,97152MHz.
Thanks in advance!
LikeLike
By Frederico on January 16, 2015 at 12:02
Hi Frederico,
these numbers look about correct. Keep in mind that WAIT is using busy waiting: so if you have interrupts interrupting it, the time will greatly vary.
If you need more accurate waiting, then I suggest that you either use an RTOS or a timer.
Erich
LikeLike
By Erich Styger on January 16, 2015 at 19:08
Hi Erich,
thanks for answering.
I will keep using the Wait functions, it was just some doubts. Yes, I’m using a interrupt based on Systick timer. It is ok for my applicaition. The wait function is only to wait some time before reading some IO operations.
Thanks!
LikeLike
By Frederico on January 17, 2015 at 16:46