[Connect EM] questions on bootloader and linux

Hi,
First, I’m working on linux and so, I can’t use the Net+OS development kit. I want to install the uCLinux kernel on the board.

My first question is how the bootloader works: I read that it get an IP by DHCP and then load a file with tftp, but it do this only if it check an error on the image, so, what is a valid image? And if I put a valid image which don’t permit to load a kernel, how can I reset the flash in order to use the original bootloader?

My second question is for the use of JTAG in order to load the image: can I use JTAG on linux? How?

Thanks a lot for your help.
Sylvain

I advice you to modify the bootloader in order to download a new image at this 2 conditions:

  • the flash image is wrong (already implemented)
  • OR if the RESET button (or an other pin) is pressed by the user.

This is very simple and it allow you to recover an application whenever yours prevent the DIGI to startup.

I don’t know for your other questions.

Paul

But if I put a valid image, the bootloader will not be launched and so, how can I put an other image?

the bootloader remains always in flash. It is the micro code that initializes your hardware and load the application stored in flash, whatever it is Linux or NETOS.

You don’t need to change the bootloader, unless you want to modify some startup features.

Paul

Yes, it remains in flash but it will download a new image by tftp only if it has detected an error on the previously downloaded image, so my question is: what is a valid image? and when there is a valid image, how to download a new one?

Thanks
Sylvain

Your image is invalid when its checksum is wrong (bad transfer for example).
If you want to download a new image, your application need to implement a FTP or TFTP server to receive the new image and store it in flash.
I am sure you will find that easily if you use uCLinux.

Paul

But if my application is buggy and the server don’t works, how can I put a new image?

here is the utility to modify the bootloader to check whether the /RESET pin (or an other pin) is set by the user. If this is the case, it should download a new application using DHCP/TFTP.
Have a look to “blmain.c” you will understand.

Paul

I’m trying to do some changes on blmain.c but I don’t understand how can I deploy it on the board?

Another question:
I’ve put a program in flash (0x02000000) but it seems not to be executed at startup, How the boot works exactly?

I send you my modified blmain.c that check if the RESET button is pushed, then download a new image.bin by DHCP/TFTP.
To load it to the card, you have to FTP the ‘rom.bin’ generated. Try it on your dev board first !

I didn’t have a look at the flash startup address so I cannot tell you. I just bother to download a image.bin using the FTP server.

Paul

By the way, are you really using the uCLinux on DIGI Connect EM ? I am very surprised because it’s not available on DIGI Connect EM…

Paul