Starting up with M52235EVB and sockets

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

Starting up with M52235EVB and sockets

2,977 Views
McGregor
Contributor I
Hi, we have just started working with M52235EVB and we know very little about it. The first step in our project is to familiarize with sockets programming in this environment (we have never used sockets in any other one) and then we have to do a program which interconnect Zigbee interface (I think we have to use Daughter Card but I don't know exactly how) to TCP/IP interface. But first of all we think it's important to know what are the resources this kit provides us. I have already installed the drivers for the P&E Multilink that allows us to use the Background Debug Mode. There is another CD related with MQX, that we have found out that it is an operating system. Related with this issue we have the following doubt: should we upload MQX to the board for us to use sockets? And there is another CD which comes with some programs to test TCP/IP stack and I think it provides us the sockets interface. Any advice about which should be the first things we have to do or anything you know about whatever these issues will be wellcome. I know I have not been very precise in my questions so I apologize for that.

Thanks in advance,

Grego
Labels (1)
0 Kudos
5 Replies

489 Views
McGregor
Contributor I
Hi Paul,

thank you very much. Your words sound us as "Let there be light". We didn't have neither tne NicheLite documentation nor the software provided by InterNiche so we were really LOST! We had already read about the two operating systems provided by InterNiche but we didn't know that they were already loaded in the board. Right now, we have mainly two questions that would be great if someone could answer:

-if we build a project with the code available in the example folder (a web server) and we load it to the board, will it work doing nothing else?

-if we upload in the board other OS such as MQX or uTasker, will we still be able to use NicheLite stack?

Thanks in advance,

Grego
0 Kudos

489 Views
mccPaul
Contributor I
Hi Grego,
 
If you build the NicheLite stack as provided by FreeScale with the sample web server task, and upload it to your board, you will have a board that has a simple console interface and a few commands, along with a webserver that has a basic flash filing system implemented.
 
If you want to do more, you will have to make changes to the stack as supplied, either by changing some of the compile time options (by changing #defined constants) to compile in extra functionality or by adding additional tasks to accomplish what you need.
 
When you build the NicheLite stack you will create a binary image that can be flashed to the beginning of the CFM flash and the board will run the stack on booting up. There is no bootloader, so if you want to write application level code, that needs to be written as a NicheLite task. With these lightweight stacks and OSes there often isn't a concept of a separate executable file. If the OS provides task switching then applications are written as tasks that co-operate with the stack/OS and other tasks by only running when they have something to do. Even more lightweight stacks often just have a superloop - a while loop in main() that calls all the task functions in turn.
 
If you upload another OS like MQX or uTasker then you will not be able to use NicheLite - that won't be a problem, because both of these (and others) provide a TCP/IP stack, ethernet and UART drivers, etc, etc. Other systems may also provide better examples that you can adapt to your requirements.
 
If you are concerned about overwriting the NicheLite stack that is already flashed, then you can download an image of the flash before you do anything else. You can use CFFlasher to do this. http://www.freescale.com/files/soft_dev_tools/software/programmers/CFFLASHER.zip?fsrch=1
 
Cheers,
 
Paul.


 
0 Kudos

489 Views
McGregor
Contributor I
Thank you very much again!

Finally we have decided to start working with NicheLite stack, but we are interested in how to download an image of the flash to be able to test other options in the future. I can do it using "upload flash" option, can't I? But I am not sure of which are the start and end addresses. Can you help me with this business?

Thanks in advance.

Best regards,

Grego
0 Kudos

489 Views
mccPaul
Contributor I
Hi Grego,
 
To copy the contents of flash to a file on your PC with CF Flasher this should work:
 
  1. Click on the 'Target Config' button.
  2. Select M52235EVB from the 'Target Configuration' drop list.
  3. Notice that the flash base address has been set to 0x00000000 by default.
  4. Select your BDM communication type and click OK.
  5. Click on the 'Upload' button.
  6. Enter your filename.
  7. Set the start address as 0x00000000.
  8. Set the end address as 0x00040000, this is 256KB - the entire flash memory.
  9. Click the 'Upload' button.

You should end up with a 256KB file that is a copy of the entire flash. I don't know what the actual end address of the NicheLite image is, but you may be able to make an educated guess by examining the contents of the flash memory using the 'Memory Window' button on CF Flasher.

You can confirm that you have the image rather than garbage by examining the file with a hex editor. The first 4 bytes will be the initial stack pointer address and the next four bytes will be the start entry point to the code (probably 0x00000400), this is followed by the vector table.

Paul.

 

0 Kudos

489 Views
mccPaul
Contributor I
Hi,
 
It sounds like you are at the start of a long learning curve!
 
My 52235 demo board came with the NicheLite stack installed. This provides a TCP/IP stack and a simple sockets implementation. The stack provides UDP, IP, ARP, ICMP ping along with other useful things like DHCP, TFTP, etc. It also provides a few other useful things like a console interface and a simple web server. It is a rudimentary OS and can run as a super loop or a co-operative multitasking system.
 
It does not have very good documentation so if you are learning, I suspect that you may struggle, especially if you have no experience with sockets programming. It may be better for you to use a commercial stack or operating system that you can get support and example applications for. If you haven't found the NicheLite documentation you can get it from the Frescale 52235 web page (http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MCF52235).
 
I assume that the MQX CD you have is an evaluation version of MQX - you will need to install that on your board. It will provide a TCP/IP stack and sockets interface, but I don't know what support you will be able to get to get you started.
 
You could also look at other offerings - UTasker (http://www.utasker.com/) for example.
 
Paul.
0 Kudos