# \[Connect EM\] questions on bootloader and linux

**URL:** <https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443>\
**Category:** Linux\
**Tags:** jtag, hardware\
**Created:** [July 18, 2007, 6:04am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443 "2007-07-18T06:04:40Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![neolistic](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@neolistic](https://forums.digi.com/u/neolistic)\
**Post date:** [July 18, 2007, 6:04am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/1 "2007-07-18T06:04:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 18, 2007, 7:14am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/2 "2007-07-18T07:14:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![neolistic](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@neolistic](https://forums.digi.com/u/neolistic)\
**Post date:** [July 18, 2007, 7:20am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/3 "2007-07-18T07:20:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 18, 2007, 7:26am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/4 "2007-07-18T07:26:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![neolistic](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@neolistic](https://forums.digi.com/u/neolistic)\
**Post date:** [July 18, 2007, 7:28am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/5 "2007-07-18T07:28:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 18, 2007, 7:56am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/6 "2007-07-18T07:56:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![neolistic](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@neolistic](https://forums.digi.com/u/neolistic)\
**Post date:** [July 18, 2007, 8:01am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/7 "2007-07-18T08:01:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 18, 2007, 2:53pm UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/8 "2007-07-18T14:53:37Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![neolistic](https://avatars.discourse-cdn.com/v4/letter/n/51bf81/32.png) [@neolistic](https://forums.digi.com/u/neolistic)\
**Post date:** [July 25, 2007, 7:18am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/9 "2007-07-25T07:18:56Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 25, 2007, 7:27am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/10 "2007-07-25T07:27:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pevandenburie](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@pevandenburie](https://forums.digi.com/u/pevandenburie)\
**Post date:** [July 26, 2007, 7:47am UTC](https://forums.digi.com/t/connect-em-questions-on-bootloader-and-linux/3443/11 "2007-07-26T07:47:27Z")

</div>

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
