[U-Boot-Users] Extremely tiny footprint

Hi everybody,
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
1. Program the first-stage boot loader in flash using JTAG (slow) 2. The first-stage boot loader downloads the final boot loader (full-featured U-Boot) using TFTP and writes it to flash (fast)
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
Laurent Pinchart

Hi Laurent,
u-boot-users-bounces@lists.sourceforge.net wrote on :
Hi everybody,
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
- Program the first-stage boot loader in flash using JTAG (slow)
There are JTAG programmers, which could work very fast (e. g. BDI2000 with workspace enabled). The limiting factor is the flash itself, not the programmer, or the JTAG interface.
- The first-stage boot loader downloads the final boot loader
(full-featured U-Boot) using TFTP and writes it to flash (fast)
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
If programming speed is the only reason for your two-step approach, then IMO this is not reasonable. It would be a waste of your time. Use a faster JTAG programmer instead. Or you could buy the flashes preprogrammed.
Regards, Martin

Hi Martin,
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
- Program the first-stage boot loader in flash using JTAG (slow)
There are JTAG programmers, which could work very fast (e. g. BDI2000 with workspace enabled). The limiting factor is the flash itself, not the programmer, or the JTAG interface.
- The first-stage boot loader downloads the final boot loader
(full-featured U-Boot) using TFTP and writes it to flash (fast)
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
If programming speed is the only reason for your two-step approach, then IMO this is not reasonable. It would be a waste of your time. Use a faster JTAG programmer instead. Or you could buy the flashes preprogrammed.
Buying the flashes preprogrammed is not an option given the quantities.
We already have a BDI2000 which has issues programming the flash using the workspace, so it reverts to the slow pure JTAG mode. I still have to investigate this directly with Abatron, we haven't found a solution so far.
Even using the internal workspace, the BDI2000 is not a very practical solution, as it wouldn't be easy to integrate it in our test bench architecture. The price is also an issue. This is why I was looking for another solution. The alternative I thought of is using a pure JTAG programmer (slow) with a tiny ethernet-enabled boot loader. The Freescale JTAG commands used to control the processor are not documented, so I can't develop a faster JTAG-only alternative. Are you aware of any other solution ?
Laurent Pinchart

If you remove any commands you don't actually need from CONFIG_COMMANDS you can strip you executable size down a fair bit. But if you need tftp support, you won't be able to get down to 32Kb.
Good luck Amnon
On 3/2/07, Laurent Pinchart laurent.pinchart@technotrade.biz wrote:
Hi Martin,
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
- Program the first-stage boot loader in flash using JTAG (slow)
There are JTAG programmers, which could work very fast (e. g. BDI2000 with workspace enabled). The limiting factor is the flash itself, not the programmer, or the JTAG interface.
- The first-stage boot loader downloads the final boot loader
(full-featured U-Boot) using TFTP and writes it to flash (fast)
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
If programming speed is the only reason for your two-step approach, then IMO this is not reasonable. It would be a waste of your time. Use a faster JTAG programmer instead. Or you could buy the flashes preprogrammed.
Buying the flashes preprogrammed is not an option given the quantities.
We already have a BDI2000 which has issues programming the flash using the workspace, so it reverts to the slow pure JTAG mode. I still have to investigate this directly with Abatron, we haven't found a solution so far.
Even using the internal workspace, the BDI2000 is not a very practical solution, as it wouldn't be easy to integrate it in our test bench architecture. The price is also an issue. This is why I was looking for another solution. The alternative I thought of is using a pure JTAG programmer (slow) with a tiny ethernet-enabled boot loader. The Freescale JTAG commands used to control the processor are not documented, so I can't develop a faster JTAG-only alternative. Are you aware of any other solution ?
Laurent Pinchart
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

Hi Laurent,
Laurent Pinchart wrote on Friday, March 02, 2007 1:35 PM:
If programming speed is the only reason for your two-step approach, then IMO this is not reasonable. It would be a waste of your time. Use a faster JTAG programmer instead. Or you could buy the flashes preprogrammed.
Buying the flashes preprogrammed is not an option given the quantities.
OK. But it seems, that the quantities are high enough, that a minute ore two more programming time does matter :-)
We already have a BDI2000 which has issues programming the flash using the workspace, so it reverts to the slow pure JTAG mode. I still have to investigate this directly with Abatron, we haven't found a solution so far.
I know workspace problems from our projects. Nearly always a wrong board (SDRAM) settup was the reason. The Abatron support is very helpful, though.
Even using the internal workspace, the BDI2000 is not a very practical solution, as it wouldn't be easy to integrate it in our test bench architecture. The price is also an issue. This is why I was looking for another solution. The alternative I thought of is using a pure JTAG programmer (slow) with a tiny ethernet-enabled boot loader. The Freescale JTAG commands used to control the processor are not documented, so I can't develop a faster JTAG-only alternative. Are you aware of any other solution ?
Possibly it makes sense to program the Flashes before soldering (with a chip programmer)? This shouldn't be faster as a BDI2000 with a working) workspace configuration, but maybe cheaper?
Sorry, don't have other ideas.
Regards, Martin

In message 200703021334.31503.laurent.pinchart@technotrade.biz you wrote:
We already have a BDI2000 which has issues programming the flash using the workspace, so it reverts to the slow pure JTAG mode. I still have to
That means you have not set up your board config file correctly.
Instead of wasting your time on a two-level bootloader approach, fix the config file instead.
Even using the internal workspace, the BDI2000 is not a very practical solution, as it wouldn't be easy to integrate it in our test bench
The BDI2000 is perfectly scriptable with expect, so what are you missing?
Best regards,
Wolfgang Denk

We already have a BDI2000 which has issues programming the flash using the workspace, so it reverts to the slow pure JTAG mode. I still have to
That means you have not set up your board config file correctly.
Instead of wasting your time on a two-level bootloader approach, fix the config file instead.
That's what I've been trying to do for the past 6 months ! Nobody have been able to help me, not even the Abatron distributor. I'm still trying to solve the issue, which involves sending hardware samples, NDAs, ... If I had known it would take so long for the support people to even work on my issue I would have gone for a two-level bootloader approach (or anything else that just works) right away.
Even using the internal workspace, the BDI2000 is not a very practical solution, as it wouldn't be easy to integrate it in our test bench
The BDI2000 is perfectly scriptable with expect, so what are you missing?
The ability to make it fit in the bed of nails. It would involve designing a new mechanical test bed. We obviously can't integrate the BDI in the test bed PCB.
Laurent Pinchart

In message 200703021629.19343.laurent.pinchart@technotrade.biz you wrote:
That's what I've been trying to do for the past 6 months ! Nobody have been able to help me, not even the Abatron distributor. I'm still trying to solve
I remember that this has been discussed before. Don;t talk to a distributor, talk to Abatron support. Of course you are supposed to have a thorough understanding of your own hardware.
Which CPU are we talking about, btw?
Best regards,
Wolfgang Denk

Hi Wolfgang,
That's what I've been trying to do for the past 6 months ! Nobody have been able to help me, not even the Abatron distributor. I'm still trying to solve
I remember that this has been discussed before. Don;t talk to a distributor, talk to Abatron support.
I contacted them directly, and they redirected me to their French distributor. We are working through NDA details so that I can send them a hardware sample. I hope to get this resolved soon.
Of course you are supposed to have a thorough understanding of your own hardware.
Obviously :-)
Which CPU are we talking about, btw?
MPC8248.
Best regards,
Laurent Pinchart

Dear Laurent!
Laurent Pinchart schrieb:
[...] not even the Abatron distributor.
You are talking to *sales people* when you have a technical problem??? Neither Abatron nor the BDI, JTAG, U-Boot or whatever is your problem...
I have to admit that I haven't worked with the BDI1000/2000 yet but I know from many people that they use it very successfully.
I'm still trying to solve the issue, which involves sending hardware samples, NDAs, ...
Have you taken a look onto your JTAG signals? Are you using RTCK (on ARM)? Have you configured it properly?
Have you configured the system and JTAG reset behaviour properly?
Did you know that an not properly terminated JTAG signals (especially pull-up and pull-down resistors and reset connection) can cause LOTS of problem in the field even when JTAG never seems to be used?
Do you use the same scan loop also for other devices on your board? Are those devices' JTAG signals connected in parallel or correct serial order? Did you configure such scan loop for your BDI?
And why don't you tell us which processor you are using?
The BDI2000 is perfectly scriptable with expect, so what are you missing?
The ability to make it fit in the bed of nails. It would involve designing a new mechanical test bed. We obviously can't integrate the BDI in the test bed PCB.
You could use another JTAG debugger, probably a much smaller device like the Rowley CrossConnect Light.
With best regards Andreas Schweigstill

Hi Andreas,
[...] not even the Abatron distributor.
You are talking to *sales people* when you have a technical problem???
The French distributor have a technical support service.
Neither Abatron nor the BDI, JTAG, U-Boot or whatever is your problem...
I have to admit that I haven't worked with the BDI1000/2000 yet but I know from many people that they use it very successfully.
I have used the BDI2000 successfully for several tasks, but it failed for flash programming.
I'm still trying to solve the issue, which involves sending hardware samples, NDAs, ...
Have you taken a look onto your JTAG signals? Are you using RTCK (on ARM)? Have you configured it properly?
Have you configured the system and JTAG reset behaviour properly?
I have (I'm using an MPC8248 processor by the way). JTAG works fine. Boundary scan works, debugging works, programming the flash memory through pure JTAG works. Only the fast flash programming mode fails.
Did you know that an not properly terminated JTAG signals (especially pull-up and pull-down resistors and reset connection) can cause LOTS of problem in the field even when JTAG never seems to be used?
Do you use the same scan loop also for other devices on your board? Are those devices' JTAG signals connected in parallel or correct serial order? Did you configure such scan loop for your BDI?
No other devices, just the MPC8248.
And why don't you tell us which processor you are using?
I asked for help regarding the BDI200 problem in the past. This thread was initially about something completely different, and the processor type was irrelevant.
The BDI2000 is perfectly scriptable with expect, so what are you missing?
The ability to make it fit in the bed of nails. It would involve designing a new mechanical test bed. We obviously can't integrate the BDI in the test bed PCB.
You could use another JTAG debugger, probably a much smaller device like the Rowley CrossConnect Light.
As far as I know, it doesn't support the PowerPC architecture. Another problem is that our test bed currently has no USB connectivity.
Best regards,
Laurent Pinchart

In message 200703021219.57763.laurent.pinchart@technotrade.biz you wrote:
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
That's not what U-Boot was designed for. You will run into problems.
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
Just use a real U-Boot. JTAG programming does not take so long. IMHO you're wasting your time.
Best regards,
Wolfgang Denk

I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
That's not what U-Boot was designed for. You will run into problems.
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
Just use a real U-Boot. JTAG programming does not take so long. IMHO you're wasting your time.
JTAG programming using the BDI2000 takes about 1s/kB. That's around 4 minutes for the real bootloader.
Laurent Pinchart

On 3/2/07, Laurent Pinchart laurent.pinchart@technotrade.biz wrote:
I would like to use U-Boot as a first-stage boot loader to program flash memory on the target board. The idea is to perform a two-steps procedure:
That's not what U-Boot was designed for. You will run into problems.
To minimize time spent in step one, I need to make the first-stage boot loader as small as possible (hopefully less than 32kB). Has anyone ever stripped U-Boot that much ? Is there any documentation available ?
Just use a real U-Boot. JTAG programming does not take so long. IMHO you're wasting your time.
JTAG programming using the BDI2000 takes about 1s/kB. That's around 4 minutes for the real bootloader.
how fast does the bdi2000 go when accessing ram? If it's fast enough you could setup the ram via the bdi-2000 by doing register writes, and use the bdi2000 to load a version of u-boot into ram, run it and then use the now resident u-boot to load a copy of itself of something else into flash.

In message 200703021625.00237.laurent.pinchart@technotrade.biz you wrote:
Just use a real U-Boot. JTAG programming does not take so long. IMHO you're wasting your time.
JTAG programming using the BDI2000 takes about 1s/kB. That's around 4 minutes for the real bootloader.
You must be doing something seriously wrong, then.
Best regards,
Wolfgang Denk

Just use a real U-Boot. JTAG programming does not take so long. IMHO you're wasting your time.
JTAG programming using the BDI2000 takes about 1s/kB. That's around 4 minutes for the real bootloader.
You must be doing something seriously wrong, then.
Remember I'm using pure JTAG mode (without workspace). Should I get faster programming in that mode (16bit data bus, MirrorBit flash) ?
Best regards,
Laurent Pinchart
participants (6)
-
Amnon Cohen
-
Andreas Schweigstill
-
Andrew Dyer
-
Laurent Pinchart
-
Martin Krause
-
Wolfgang Denk