Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - johnr

Pages: 1 [2]
NXPTM M522XX, KINETIS and i.MX RT / Web Server not responding
« on: October 17, 2007, 02:36:23 PM »
Hi, I've been testing my new web page overnight for the last 2 nights
and when I come back in the morning  the browswer is hung in a "Cannot
find server" screen. I can still ping and FTP the board at this point, but can't access any web page. This has happened before I included the floating point library in the project and afterwards.
 My test page uses "<meta http-equiv="refresh" content="20">"  to
refresh the page every 20 secs. I've tested the page during the day
and it looks OK, displaying the proper values etc.
 I made the changes in the web server code to supports 5 char £xxxx
sequences and every page looks OK. The code I added in webinterface.c
in fcInsertString() to handle my new page is

Code: [Select]
case 'W': //  ADC Raw
cPtr = fnDebugDec( (long)ADC_Chans[iChan].Raw, 0, cValue);
*usLengthToSend = (cPtr - cValue);

case 'Z': // ADC Min
         cPtr = fnDebugDec( (long)ADC_Chans[iChan].Min, 0, cValue);
    *usLengthToSend = (cPtr - cValue);

case 'H': // ADC Max
        cPtr = fnDebugDec( (long)ADC_Chans[iChan].Max, 0, cValue);
    *usLengthToSend = (cPtr - cValue);

case 'T': // ADC AlarmLo
cPtr = fnFltToStr(ADC_Chans[iChan].AlarmLo, cValue);
    *usLengthToSend = (cPtr - cValue);

case 'G': // ADC AlarmHi
          cPtr = fnFltToStr(ADC_Chans[iChan].AlarmHi, cValue);
*usLengthToSend = (cPtr - cValue);

case 'Q': // ADC AlarmState
         *usLengthToSend = (cPtr - cValue)-1;

 Looking at the memory stats before and after it hangs shows
     Free heap = 0x0af4 from 0x4c00
     Unused stack = 0x2823
 so that looks OK.

 I can try refreshing a dummy page that doesn't do any
dynamic processing overnight and see what happens. I've been running
my regular page for 3.5 hours this morning so far and it hasn't
failed yet. I've been running these tests from the CW debuger.

Here's my string <--> float functions, but the web hung before used these

Code: [Select]
float fnStrToFlt(char* aStr) {
// Convert a non terminated string to a float. Limited to 1 dec place

float Result=0;
int i,Frac=0;
int Mult=1,Len;
int DecPlaces=0;
char* pEnd=aStr;
char* pDec=NULL;

  while (((*pEnd>='0') && (*pEnd<='9')) || (*pEnd=='.') ) {
// Find the end of the str
if (*pEnd=='.')
  pDec=pEnd;  // Remember decimal place
  if  (pDec)

  while (DecPlaces>1) {
// Limit to 1 dec place

  while (Len-->0) {
if (DecPlaces>0) {
  if (*pEnd!='.')
  pEnd--; // Skip dot
else {
  if  (Frac>0)

char* fnFltToStr(float aFlt, char* aStr) {
// Convert a float to a non terminated string. Return
// a pointer to the next char posistion that would have
// been written. Len of the string=cp-aStr. Limited to 1 dec
// place 

int i=(int) aFlt; // Chop off fraction
float f=aFlt-i; // Fraction
char* cp;

cp=fnDebugDec(i,0,aStr); // int part
*cp++='.'; // decimal point
if ((f*=10)) {
if ((int) (f*10)>=5)

cp=fnDebugDec(i,0,cp); // fractional part


NXPTM M522XX, KINETIS and i.MX RT / CW 6.3 librarys and floating point
« on: October 12, 2007, 04:04:22 PM »
 After playing around with librarys the last 2 days, here's
what I found.

 If I add C_4i_SZ_MSL.a to the support files, I can use malloc() by
including "stdlib.h" in the source. In order to do this I must
comment out size_t in types.h because stdlib.h defines this as an
unsigned long and we get "size_t redeclacred" errors. When I remove  C_4i_SZ_MSL.a from Support Files, I get an error, "can't find malloc()"
so this tells me I can use MSL libs in the project.

  I modified ansi_prefix_CF.size.h in the FreeScale CW tree as per
a FreeSCale thread and re built MSL_C.CF mcp  by opening up
the project in the FreeScale CW tree.  After adding C_4i_MSL.a
to the Support Files and using the test code I get a "_f_itoa" link

// ansi_prefix_CF.size.h in FreeScale tree
#if !(__COLDFIRE__ == 0x4080 && !__option(fp_library))
////#define _MSL_FLOATING_POINT      0
////#define _MSL_NO_MATH_LIB                    1
#define _MSL_FLOATING_POINT      1

////#define _MSL_FLOATING_POINT_IO            0
#define _MSL_FLOATING_POINT_IO      1

// Simple float test code
 float f;
 int i;


 I also tried adding libgcc.a and libm.a from my CodeSourcery 4.11
tree to Support Files and get the same link errors. I called a CW
sales rep and asked if floating point is supported in all the versions
and am waiting to hear back.

 One thing I noticed after adding the C_4i_MSL.a lib to the project is
that the floating point option in the Coldfire Processor property tab
is still disabled. When I flipped around to use other processers it
seems to only get enabled when you specify a chip that has a hardware



NXPTM M522XX, KINETIS and i.MX RT / Floating point library
« on: October 09, 2007, 07:37:13 PM »
Hi , we may need to use floating point to do some ADC conversions.
The CW 6.3 lite help mentions that the M52233 lacks an FPU and in order
to enable software FP you must "include the appropriate FP_Coldfilre library"
into your project. I looked in the CW help and can't see how to do this.
Anyone ever include FP in their projects and if so how much memory would this


 I'm trying to set a breakpoint in fnInsertStrings() to debug my ADC web page that
returns the 8 channels of ADC raw values etc. The code gets executed because I see the
dynamic values displayed on the web page, but the break point I set gets ignored. I can set break points in my adc.c function that handles reading the ADC every 1 sec.


« on: September 26, 2007, 10:01:59 PM »
Hi , anyone add SNMP traps or agents to the uTasker ? Will this
be available some time  in the future ?


NXPTM M522XX, KINETIS and i.MX RT / volatile regs
« on: September 25, 2007, 09:13:30 PM »
 I started setting up the ADC and I'm using the ini code
genertaed by the Freescale init software that allows you to
plug in some params and it generates the C code to ini various
peripherals. While debugging in mixed view mode I noticed the

 // Wait for converter A power up to complete

would never fall through because the compile was not re reading the
MCF_ADC_POWER reg. I changed the definition to make it volitale

#define ADC_POWER           *(volatile unsigned short *)(ADC_ADD + 0x52)          // ADC Power Control register

but it still wouldn't work. I had to change the CodeWarrior global
optimization from 4, generate smallest code to 2 to get it to
work. I had to remap the M5223x.h files to a new file which uses the
reg naming conventions used by the FreeScale init utility ie

  #define MCF_ADC_POWER              ADC_POWER  etc

I see where various regs in M5223x.h are using the volatile keyword
and it works with full optimization. Why do I have to lower it
to get the ADC loop to work ?


NXPTM M522XX, KINETIS and i.MX RT / Web pages and FTP upload
« on: September 13, 2007, 07:13:24 PM »
 Hi, I uploaded the web pages in the /WebPagesM5223X and everything works OK.
When I uploaded the 5emailsetup page in /alternativepages I noticed it has the same
prefix as admin page, 5. When you click on admin the email setup page overrides the admin page. When I refresh the FTP page in IE I see that all the files are
shortened to 1 char plus an extension, ie 1.HTM b.GIF etc.
 I modified Omenu.HTM, and added a email setup menu link,changed the target to Eemailsetup.htm and renamed 5emailsetup.HTM to Eemailsetup.htm. When I did this I nocticed when I click on the LAN config that the IO config pops up with some uninterpreted text at the top. When I tried uploading the  Eemailsetup.htm it appears that some of the files disappear. I believe the demo project allocates 98K for code and the rest for files and params and each file takes up at least 2K. It seems we can only upload 9 files at a time.


NXPTM M522XX, KINETIS and i.MX RT / bare min app link errors
« on: September 12, 2007, 09:29:54 PM »
 Hi, I'm using the CW 6.3 light version and I see 2 projects in the list box on in the upper
left corner of the IDE when I open uTakserV1.3.mcp,  M52235EVB_ROM and bare_min_app_rom. I can build and run M52235EVB_ROM with no problem. When I select bar_min_app_rom I get the following link errors :

 Undefined  "main"  from start in startup.s
 Undefined  "mcf52235_init"  from start in startup.s

 I read through the docs but can't see anything I have to set.
 Any ideas ?


NXPTM M522XX, KINETIS and i.MX RT / Email
« on: September 06, 2007, 04:19:49 PM »
 I defined SMTP and FTP in config.h and uploaded the web pages. The LAN config page
shows all the values I programmed in applications.c, except the DNS server is not shown.
In the admin page the fields initially display garbage, ie "?vX2" etc except password and
the SMTP server addr field is disabled. When I enter a value in the SMTP IP field and
save it, it display as garbage again.


NXPTM M522XX, KINETIS and i.MX RT / Code warrior debug & Web Page
« on: September 04, 2007, 09:34:33 PM »
 I just installed the CodeWarrior 6.3 IDE and opened up the uTaskerV1.3.mcp
and set the target to M52235EVB_ROM. It compiles OK. I noticed that in order to
flash it into the M52233DEMO I had to use the FreeScale flash utilty. If I run this first
I am able to then use the CW debugger on the code. If I make a code change and try
to run it from CW, it displays the status like it's down loading 78K bytes etc, but when
it runs, it's running the previous code that was flashed in with the FreeScale utilty.
Is this a feature of the free 128K limit version of CW ?

 When I try to access a web page on the pcb I get a uTasker 404 error, page not found.
I access it with my IP address, ie I tried accessing astats.htm, index.htm etc  with the same result. HTTP is set in config.h. Is there something else that must be set ?


NXPTM M522XX, KINETIS and i.MX RT / codeSourcery and SP5 code
« on: August 29, 2007, 07:55:46 PM »
 We've been working the last few days trying to get uTasker running on our
M52233DEMO pcb. Here's the results so far:

 Using codeSourcery 4.2.23 IDE to compile and debug

1) I had to modify the m52335evb-rom.ld file to include the _init and _fini lables
in order to compile without errors. When I ran it in the debugger it would
run for about 30 secs then stop the the following debug console message:

   Sourcery G++ Debug Sprite for ColdFire ELF (8/29/07 2:40 PM) (Suspended)   
  • (Suspended: Signal 'SIGTRAP' received. Description: SIGTRAP.) <Stack is not available: Target is not responding (timed out).>   


 I modified the source code to disable the WATCHDOG and added the RTC interuppt
vector. I modified the makefile to use -O2 and -mcpu=52233. It still would not run.

I tried a uTaskerV1.3.elf file that was compiled with codeSourcery 4.1.32 and
I was able to run it where it hit a breakpoint in main(). I talked to codeSourcery and
they told me to download the 4.1.23 package and try it. I did this and compiled
the code with with following warnings :

..\..\..\Hardware\M5223X\M5223X.c: In function '_SCI1_Interrupt':
..\..\..\Hardware\M5223X\M5223X.c:1359: warning: unused variable 'ucDummy'
..\..\..\Hardware\M5223X\M5223X.c: At top level:
..\..\..\Hardware\M5223X\M5223X.c:354: warning: '_sw_wdog_timeout' defined but n
ot used
..\..\..\stack\http.c: In function 'fnHTTPListener':
..\..\..\stack\http.c:560: warning: 'ucPush' may be used uninitialized in this f
..\..\..\stack\http.c:559: warning: 'Len' may be used uninitialized in this func
c:/program files/codesourcery4.1.32/sourcery g++/bin/../lib/gcc/m68k-elf/4.1.1/.
./../../../m68k-elf/bin/ld.exe: warning: cannot find entry symbol _start; defaul
ting to 00000000

 I didn't get that last warnnig compiling under 4.2.23. When I tried debugging this elf
with the 4.2.23 IDE it would stop immediately with the following debug console message:

Sourcery G++ Debug Sprite for ColdFire ELF (8/29/07 2:50 PM) (Suspended)   
  • (Suspended: Signal 'SIGTRAP' received. Description: Trace/breakpoint trap.)   

      1 <symbol is not available> 0x1fffffff   

 I'm stuck at this point.



NXPTM M522XX, KINETIS and i.MX RT / Source tree question
« on: August 28, 2007, 07:07:00 PM »
 I'm starting to study the source files and see references like

 #ifdef _M5223x , #ifdef  _CODE_WARRIOR_CF etc in config.h and other files
but can't find where these labels are defined. Am I missing something ?


NXPTM M522XX, KINETIS and i.MX RT / codeSourcery 4.2-23 compile error
« on: August 24, 2007, 09:31:23 PM »
Hi, I just started using uTasker and downloaded SP4 and the latest loader script
and I'm trying to  compile it with codeSourcery 4.2-23 and get the followng error:

cs-make -k all
m68k-elf-gcc -mcpu=52235 -Wall -Wstrict-prototypes  -D _GNU -D _M5223X -g -c -Os ..\..\..\Hardware\M5223X\Startup_gnu.s -o Build\Startup_gnu.o
m68k-elf-gcc -mcpu=52235 -nostartfiles -Wall -Wstrict-prototypes -I..\..\uTaskerV1.3 -D _GNU -D _M5223X -g -Os -Wl, -Tm52235evb-rom.ld -o uTaskerV1.3.elf Build\application.o Build\debug.o Build\webInterface.o Build\KeyScan.o Build\LCD.o Build\NetworkIndicator.o Build\Startup_gnu.o Build\M5223X.o Build\eth_drv.o Build\Driver.o Build\uMalloc.o Build\uTasker.o Build\Tty_drv.o Build\uFile.o Build\watchdog.o Build\GlobalTimer.o Build\low_power.o Build\Ethernet.o Build\arp.o Build\dhcp.o Build\dns.o Build\ftp.o Build\http.o Build\icmp.o Build\ip_utils.o Build\ip.o Build\pop3.o Build\smtp.o Build\tcp.o Build\telnet.o Build\tftp.o Build\udp.o Build\webutils.o
c:/program files/codesourcery/sourcery g++/bin/../lib/gcc/m68k-elf/4.2.0/../../../../m68k-elf/lib/m5208\libcf.a(cf-crt1.o): In function `__start1':
cf-crt1.c:(.text+0x9a): undefined reference to `_init'
cf-crt1.c:(.text+0xa0): undefined reference to `_fini'
c:/program files/codesourcery/sourcery g++/bin/../lib/gcc/m68k-elf/4.2.0/../../../../m68k-elf/lib/m5208\libc.a(lib_a-fini.o): In function `__libc_fini_array':
fini.c:(.text+0x42): undefined reference to `_fini'
collect2: ld returned 1 exit status
cs-make: *** [uTaskerV1.3.elf] Error 1
cs-make: Target `all' not remade because of errors.

 I was able to compile the Cambridge Imaging example hello world project with no problem. The updated loader script did clear up the _region array reference error in cf-crt1.c

 Thanks for any ideas,

Pages: 1 [2]