Project

General

Profile

Programming the FPGA

Added by Craig Meyers about 9 years ago

I'm following these Wiki instructions and I'm not getting the DONE led:

U-Boot > loadb 0xC0700000
  1. Ready for binary (kermit) download to 0xC0700000 at 115200 bps...
  2. Total Size = 0x00071544 = 464196 Bytes
  3. Start Addr = 0xC0700000
    U-Boot > sf probe 0
    8192 KiB M25P64 at 0:0 is now current device
    U-Boot > sf erase 0x580000 0x80000
    U-Boot > sf write 0xC0700000 0x580000 ${filesize}
    uBoot> setenv bootfpga 'sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000'

I'm using the supplied IndustrialIO.bin file.

I feel like I'm missing something. At what point do I expect to light the LED? On the next boot?


Replies (40)

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig
The DONE led should go on immediately after programming the FPGA.
Can you try running the commands in the bootfpga variable from the prompt?
ie:
uBoot> sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000
and see if that loads it correctly?
It looks like the steps you followed should be correct!

cheers
/Tim

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig,
another thing to check is that the configuration of the device is correct.
if you run factoryconfig at the U-Boot> prompt it will tell you what the FPGA and Part Numbers are.
Make sure that this info jives with what you really have.
[As an example... the board on my desk shows]
U-Boot > factoryconfig
Factory Configuration:
Config Version : 1.1
MAC Address : 00:50:C2:BF:89:30
Serial Number : 100691
FPGA Type : 2 [XC6SLX16]
Part Number : L138-CG-225-RC
U-Boot >
cheers
/Tim

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Thanks Tim.

No DONE led yet but looks as if I made progress:

U-Boot > sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000
8192 KiB M25P64 at 0:0 is now current device
Loading FPGA from 0xC0700000 with 0x80000 bytes
Loading FPGA done

The FPGA type is correct:

U-Boot > factoryconfig
Factory Configuration:
Config Version : 1.1
MAC Address : 00:50:C2:BF:8E:8D
Serial Number : 110550
FPGA Type : 4 [XC6SLX45]
Part Number : L138-FI-225-RC
U-Boot >

Your thoughts?

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig
Aha!
The default size for uboot's loadfpga command (and what is shown on the wiki!) is 0x80000 (1/2MB), which is for the LX16 part.
For the LX45 part, the file is much larger (1484404 bytes [ 0x16A674]), so all the parameters will need to be adjusted accordingly.

You can still download the file to 0xc0700000, but the flash args will need to change.
Something like
U-Boot > sf probe 0
8192 KiB M25P64 at 0:0 is now current device
U-Boot > sf erase 0x580000 0x16b000
U-Boot > sf write 0xC0700000 0x580000 ${filesize}
uBoot> setenv bootfpga 'sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x16b000'
I don't have the larger part right here to definitively check it, but that should work

cheers
/Tim

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Tim - I think we are getting close.

Here's the result:

U-Boot > sf erase 0x580000 0x16b000
SPI flash erase failed

RE: Programming the FPGA - Added by Gregory Gluszek about 9 years ago

Hi Craig,

The flash erase needs to be page aligned. This should work:

U-Boot > sf erase 0x580000 0x170000

However, we still might have issues after that. I'm guessing that the IndustiralIO.bin file you have was built for the LX16 and not the LX45 part. Which IndustrialIO.bin file are you using?

Thanks,
\Greg

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Hi Greg.

This command worked: U-Boot > sf erase 0x580000 0x170000

But you are right. I still have issues.

I got the IndustrialIO.bin file from the Wiki: [[http://support.criticallink.com/redmine/projects/arm9-platforms/wiki/Programming_the_FPGA]]

I wondered about that. Env var filesize = 71544

Is there a different version of IndustrialIO.bin that I should be using for the 45k FPGA?

And would other parameters change like 0x80000 to 0x16A674?

RE: Programming the FPGA - Added by Gregory Gluszek about 9 years ago

Hi Craig,

I've attached a .bin file that should work for you (in the future we will add LX45 example .bin files to the MDK releases).

As far as the bootfpga command, the following should work for the LX45:

U-Boot > setenv bootfpga 'sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x170000'

Let us know if you have any other issues.

Thanks,
\Greg

IndustrialIO.bin - LX45 Industrial IO Board FPGA (no display support) (1.42 MB)

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Good news / bad news.

It was a successful load. Green DONE led lit.

However, I apparently hammered the flash with an incorrect sf statement. I'm going to follow the dead board instructions to unbrick this board.

In the meantime, what do I need to do to get the FPGA to load on boot?

I'm not clear on where bootfpga is run during boot process:
setenv bootfpga 'sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x170000'

It seems like I need to take additional action in U-BOOT.

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig
If you set the bootfpga environment var, uboot will automatically run the commands at startup. I'm not exactly sure when in the boot process it runs, but it is fairly early one.
cheers
/Tim

p.s. Don't forget to run the saveenv command after modifying the environment to save it back to flash!

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Tried dead board instructions (sfh_OMAP-L138 -flash -v -p COM7 UBL_SPI_MEM.ais u-boot.bin) and I get read error:

(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 8484-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(Serial Port): Read error! (The operation has timed out.)
(AIS Parse): I/O Error in read!

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig
I see your serial port is COM7.. I presume that is a USB serial dongle? What brand / model is it? We have had some troubles with various dongles trying to push lots of data across them. Can you run it using a "real" serial port?

Also, how many times have you tried this? If you've only tried it once, give it another whirl... sometimes that app will time out.

The command you show here is the correct one. When it starts, does it print the version information (it should).
I am using 1.67 (size is 241,664 bytes, File version (windows explorer properties->Details) is 1.67.3937.18170

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Yes. I'm using USB to serial dongle. It's unbranded using Prolific chipset. Unfortunately I do not have a "real" serial port on my laptop.

I've tried this several times with same result.

Full version on sfh_OMAP-L138.exe is 1.67.3841.22503 (size is 200,704 bytes).

Port settings on the USB-to-serial driver (thru device manager) are 115200 / 8 / None / 1 / None. Under advanced I have "use FIFO buffers" checked (default). I've tried increasing and decreasing the recv and xmit buffers. But still get same error.

Any ideas?

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

I've tried several other usb to serial adaptors with no luck.

I get the same error:
(AIS Parse): Performing Opcode Sync...
(Serial Port): Read error! (The operation has timed out.)
(AIS Parse): I/O Error in read!

Do I have the correct files/versions to flash this board?
CPU Engine - L138-FI-225-RC
Industiral IO Board - 80-000268RI-1

RE: Programming the FPGA - Added by Tim Iskander about 9 years ago

Craig
I have uploaded the latest serial programming utility to the files section.
Try that and see if it corrects your timeout issue.
cheers
/Tim

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Hi Tim,

Do I need a different version of SPIWriter_MityDSP-L138.out? Didn't see this file in the latest zip.

I tried this latest version of the utility with these results. A little different - also read error prior to BOOTME received!

(AIS Parse): Read magic word 0x41504954.
(AIS Parse): Waiting for BOOTME... (power on or reset target now)
(Serial Port): Read error! (The operation has timed out.)
(Serial Port): Read error! (The operation has timed out.)
(Serial Port): Read error! (The operation has timed out.)
(AIS Parse): BOOTME received!
(AIS Parse): Performing Start-Word Sync...
(AIS Parse): Performing Ping Opcode Sync...
(AIS Parse): Processing command 0: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(AIS Parse): Loading section...
(AIS Parse): Loaded 9340-Byte section to address 0x80000000.
(AIS Parse): Processing command 1: 0x58535901.
(AIS Parse): Performing Opcode Sync...
(Serial Port): Read error! (The operation has timed out.)
(AIS Parse): I/O Error in read!

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Hi Tim.

I'm on my 3rd USB-to-serial adapter and 4th attempt at driver update. I'm sure some manager got a nice bonus for taking cost out of these adaptors.

I've finally programmed the flash. The board now boots to U-BOOT with no problems.

Thanks for you help (and patience).

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Can you guys zip up and post or e-mail me source files used to generate this .bin?

I would like to play some with the FPGA.

IndustrialIO.bin - LX45 Industrial IO Board FPGA (no display support) (1.4 MB)

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Question on automatically loading the FPGA at boot...

I've followed these instructions:

loadb 0xC0700000
[send the correct IndustrialIO.bin using kermit]

sf probe 0
sf erase 0x580000 0x170000
sf write 0xC0700000 0x580000 ${filesize}

sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x170000

[FPGA is successfully loaded - green DONE LED is lit]

setenv bootfpga 'sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x170000'

saveenv

[hit boot button]
[green DONE LED extinguishes]
[UBOOT commences booting]
[FPGA is successfully loaded - green DONE LED is lit again -
as indicated during boot -> Loading FPGA from 0xC0700000 with 0x170000 bytes
Loading FPGA done]

Now when I try another reboot...

[hit boot button]
[green DONE LED extinguishes]
[UBOOT commences booting]
[FPGA is NOT successfully loaded - green DONE LED does NOT LIGHT -
but I get these messages during boot -> Loading FPGA from 0xC0700000 with 0x170000 bytes
Loading FPGA done]

Subsequent reboots are unsuccessful.

UBOOT thinks I have 128 MB DDRm / DRAM:
Configuring 128MB mDDR
DRAM: 128 MB

Could this be a problem? Maybe I need a different image?

RE: Programming the FPGA - Added by Michael Williamson about 9 years ago

Hi Craig,

For the bootgpga image, you need to read out all of the image into RAM before trying to program the FPGA.

I think you need to change:

sf probe 0; sf read 0xc0700000 0x580000 0x80000; loadfpga 0xc0700000 0x170000

to:

sf probe 0; sf read 0xc0700000 0x580000 0x170000; loadfpga 0xc0700000 0x170000

You're factory config indicates L138-FI-225-RC. The 225 means 128 MBytes of RAM, 256 MB of NAND, and 8 MB of SPI NOR. Is this consistent with the module label?

Module L138-FI-236-XX includes a 256 MB DDR2 and 512 MB NAND (edited from original). We have only shipped a few of these devices. Do you have one of these?

-Mike

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

The revised read instruction works!

We have the L138-FI-225-RC. My mistake. I was looking at the wrong line in the orderable section in the L138 SOM spec.

Thanks for all your support in our "startup" activities. In me you are dealing with a novice.

Back to my earlier question:

Can you guys zip up and post or e-mail me source files used to generate this .bin?

I would like to play some with the FPGA.

IndustrialIO.bin - LX45 Industrial IO Board FPGA (no display support) (1.4 MB)

RE: Programming the FPGA - Added by Gregory Gluszek about 9 years ago

Hi Craig,

I've attached the project file used to build the .bin file I posted earlier. You'll need to link against our cores in order to build this project, and those can be found in the latest MDK release.

\Greg

example.zip - XISE project and source for IndustrialIO.bin - LX45 Industrial IO Board FPGA (no display support) (60.1 KB)

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

Hi Greg,

Thanks for XISE files.

I followed instructions from Linux Kernel installtion using uImage from files area and the boot gets stuck as shown below (starting kernel). Maybe I need the uImage file that came preloaded on the board?

Hit any key to stop autoboot: 0
8192 KiB M25P64 at 0:0 is now current device
  1. Booting kernel from Legacy Image at c0700000 ...
    Image Name: Linux-2.6.34-rc1-07430-g2e70fb6
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 1818012 Bytes = 1.7 MB
    Load Address: c0008000
    Entry Point: c0008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

Starting kernel ...

RE: Programming the FPGA - Added by Craig Meyers about 9 years ago

I tried again in case I screwed up the first time.

I also tried the uImage file in /boot on another of our boards. That image got stuck in the same way.

From files area: Linux-2.6.34-rc1-07430-g2e70fb6
From another of our dev kits /boot directory: Angstrom2.6.33+gitr0+efef2daa19

Any ideas?

RE: Programming the FPGA - Added by Michael Williamson about 9 years ago

Hi Craig,

Are you programming the FPGA before you load the kernel? The FPGA can cause problems with the kernel load if you are driving unused pins that might be tied to interrupt lines or NMI lines.

You may need to build that latest kernel from source, as it has some bug fixes since that original kernel was posted. We are in the processing of prepping a new release that would have a stock image suitable for Industrial I/O boards, but that won't be ready until sometime next week.

I'll try to post a kernel image for you, but you should probably go through a build exercise of the kernel anyway, as you'll likely need to enable/disable various features for your final application.

-Mike

(1-25/40)
Add picture from clipboard (Maximum size: 600 MB)