M52235EVB issues and questions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

M52235EVB issues and questions

1,084 Views
allawtterb
Contributor IV
First of all, I just started playing with the M52235EVB in light of an upcoming project that will be using hte 52235 and ethernet.  My previous experince with Freescale is with HCS08/HCS12 devices.  I was playing around with the EVB and noticed some issues as soon as I tried to use the RTOS example project that comes with the EVB.  The LEDs were blinking quiet slowly and the console was very unresponsive while running the ColdFire_Lite_RTOS target. 
 
It quickly became clear something was wrong with the tasking system and it was a very simple basic problem.  After a quick debug session it shows that cticks was not being checked properly in the section of tk_block that looks for tasks to run.  The problem is cticks was declared as a  simple unsigned long, while it was still being modified in an ISR and checked in the main flow of the program.  It seems the compiler optimized some accesses to cticks and as such it doesn't check it properly.  The simple solution is declaring cticks as volatile in main.c and  ipport.h.  Does anyone know if there are similiar problems with these projects that I should look at before proceeding?
Labels (1)
0 Kudos
1 Reply

311 Views
RichTestardi
Senior Contributor II
Hi,
 
I'm not sure exactly which version of the stack you have, but in the one I have, you need to change the default number of BIG and LIL bufs in ipport.h, to both not run out of memory and not run into deadlocks.  I use:
 
#define NUMBIGBUFS   4     //FSL stack not work for <4
#define NUMLILBUFS   14
I also sent the following to FSL when they requested feedback.  Maybe it will help.
 
--------
 
Hi Eric,
 
If you are still looking for feedback on what could be fixed in the ColdFire TCP/IP stack, I have a few comments regarding the source code.
 
Depending on the calling conventions specified by the user, the existing code can break.  For example, if I compile with "Register" parameter passing, then the assembly language functions break because they expect "Compact" calling conventions.  These bugs can easily be fixed by adding a compact_abi declaration to the function declarations, such as:
 
######## ./h/ip.h ########
428c428
< unsigned short cksum(void*, unsigned);
---
> __declspec(compact_abi) unsigned short cksum(void*, unsigned);
 
######## ./h/task.h ########
90,92c90,92
< stack_t * tk_frame(task *, int(*)(int), unsigned);
< void      tk_switch(task *);  /* run the next task */
< stack_t * tk_getsp(void);             /* get current stack pointer */
---
> __declspec(compact_abi) stack_t * tk_frame(task *, int(*)(int), unsigned);
> __declspec(compact_abi) void      tk_switch(task *);  /* run the next task */
> __declspec(compact_abi) stack_t * tk_getsp(void);             /* get current stack pointer */
 
Also, if I enable the use sdata and sbss, the tasking system gets confused because it forgets to load A5 (the sdata/sbss base register) for the "other " tasks.  This can be easily fixed to propagate A5 at task creation time, such as:
 
######## ./cf_specific/tk_util.s ########
113a114
>    move.l  A5,40(A0)            // _SDA_BASE
 
These were the only places I was forced to change the existing code.
 
Thank you!
 
-- Rich
 
0 Kudos