MCS file parsing error.
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- cli, embedded-iot, tooling
Research direction
The reporter bisected the failure to src/mcsParser.cpp after v0.13.1: MCS writes get a wrong end_addr (Spartan-3E verify fail at 0; Kintex-7 flash overflow) while BIT files still work. Diff that file against tags/v0.13.1, then trace how record addresses and length are accumulated into start/end for SPI flash. Confirm a fix by writing the same MCS with --verify on a matching part; no tests or extra files are named in the issue.
Written by the indexing model from the issue text.
Description
I am trying to write an MCS file to SPI flash on custom boards with Xilinx FPGA. Firmware size or verification errors occur. There are no errors when writing the original BIT file to the flash.
$ ./build/openFPGALoader -V
openFPGALoader v1.0.0
Write to the Spartan3e board. When writing MCS - end_addr: 00080000 and the check failed. If I write BIT - end_addr: 00030000
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc3s250evq100 -f 1/fpga_xc3s.mcs --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc3s250evq100.bit.gz
Load SRAM: [==================================================] 100.00%
Done
jtag_chain_len: 1
SOJ version: 1.000000
Detail:
Jedec ID : 20
memory type : 20
memory capacity : 12
flash chip unknown: use basic protection detection
start addr: 00000000, end_addr: 00080000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Verifying write (May take time)
Reading: [==================================================] 100.00%
Fail
Verification failed at 0
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc3s250evq100 -f 1/fpga_xc3s.bit --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc3s250evq100.bit.gz
Load SRAM: [==================================================] 100.00%
Done
jtag_chain_len: 1
SOJ version: 1.000000
Detail:
Jedec ID : 20
memory type : 20
memory capacity : 12
flash chip unknown: use basic protection detection
start addr: 00000000, end_addr: 00030000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Verifying write (May take time)
Reading: [==================================================] 100.00%
Done
Write to the Kintex7 board.
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc7k410tffg900 -f 1/fpga_xc7t.mcs --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc7k410tffg900.bit.gz
load program
Load SRAM: [==================================================] 100.00%
Done
Shift IR 35
ir: 1 isc_done 1 isc_ena 0 init 1 done 1
jtag_chain_len: 1
SOJ version: 2.000000
JEDEC ID: 0x20bb18
Detected: micron MT25/N25Q128_1_8V 256 sectors size: 128Mb
flash overflow
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc7k410tffg900 -f 1/fpga_xc7t.bit --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc7k410tffg900.bit.gz
load program
Load SRAM: [==================================================] 100.00%
Done
Shift IR 35
ir: 1 isc_done 1 isc_ena 0 init 1 done 1
jtag_chain_len: 1
SOJ version: 2.000000
JEDEC ID: 0x20bb18
Detected: micron MT25/N25Q128_1_8V 256 sectors size: 128Mb
00000000 00000000 00000000 00
start addr: 00000000, end_addr: 00680000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Verifying write (May take time)
Reading: [==================================================] 100.00%
Done
When I restored src/mcsParser.cpp from release 0.13.1 and rebuild the project, then there are no errors and the MCS file is successfully written to flash.
$ git checkout tags/v0.13.1 src/mcsParser.cpp
Updated 1 path from 3378212
$ cmake --build build
[ 1%] Building CXX object CMakeFiles/openFPGALoader.dir/src/mcsParser.cpp.o
[ 3%] Linking CXX executable openFPGALoader
[100%] Built target openFPGALoader
[100%] Built target bit
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc3s250evq100 -f 1/fpga_xc3s.mcs --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc3s250evq100.bit.gz
Load SRAM: [==================================================] 100.00%
Done
jtag_chain_len: 1
SOJ version: 1.000000
Detail:
Jedec ID : 20
memory type : 20
memory capacity : 12
flash chip unknown: use basic protection detection
start addr: 00000000, end_addr: 00030000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Verifying write (May take time)
Reading: [==================================================] 100.00%
Done
$ OPENFPGALOADER_SOJ_DIR=./spiOverJtag ./build/openFPGALoader -c digilent_hs2 --fpga-part xc7k410tffg900 -f 1/fpga_xc7t.mcs --verify
empty
write to flash
Jtag frequency : requested 6.00MHz -> real 6.00MHz
Open file DONE
Parse file DONE
Use: ./spiOverJtag/spiOverJtag_xc7k410tffg900.bit.gz
load program
Load SRAM: [==================================================] 100.00%
Done
Shift IR 35
ir: 1 isc_done 1 isc_ena 0 init 1 done 1
jtag_chain_len: 1
SOJ version: 2.000000
JEDEC ID: 0x20bb18
Detected: micron MT25/N25Q128_1_8V 256 sectors size: 128Mb
00000000 00000000 00000000 00
start addr: 00000000, end_addr: 00680000
Erasing: [==================================================] 100.00%
Done
Writing: [==================================================] 100.00%
Done
Verifying write (May take time)
Reading: [==================================================] 100.00%
Done
Best regards,
Pavel
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 396
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 15
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from trabucayre/openFPGALoader
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
trabucayre/openFPGALoader#767 ·
Maintainers usually reply within 1 day
-
Done Wait for feedback
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
trabucayre/openFPGALoader#735 · 2 comments ·
Maintainers usually reply within 1 day
-
spiFlash: sectors_erase() erases outside the requested rangePossibly taken @Milo0x1 claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 20/100
trabucayre/openFPGALoader#765 ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
trabucayre/openFPGALoader#753 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
trabucayre/openFPGALoader#752 · 1 comment ·
Maintainers usually reply within 1 day
All issues in trabucayre/openFPGALoader
Similar issues
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/DirectXShaderCompiler#9155 ·
Maintainers usually reply within 2 days
-
Errors in 1.20 proseOpenCampaign DiD Campaign EI Campaign HttT Campaign TDG Campaign TSG Campaign WoF Enhancement Help Prose Stable 1.20
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wesnoth/wesnoth#11749 · 2 comments ·
Maintainers usually reply within 1 day
-
agent:Windows bug in progress pri:medium sev:low testing windows
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#125651 ·
Maintainers usually reply within 1 day