efabless / caravel_board

32 stars 41 forks source link

MPW5 *** read compare FAILED *** and Winbond SRAM not found #110

Closed hugodiasg closed 3 months ago

hugodiasg commented 3 months ago

Hi, I'm with a problem during the blink example with my MPW5 board.

When I use the caravel Nucleo Board + STM Nucleo Board, I get:

Success: Found one matching FTDI device at ftdi://ftdi:232h:1:d/1

Caravel data:
   mfg        = ffff
   product    = ff
   project ID = ffffffff

Resetting Flash...
status = 0x00

JEDEC = b'000000'
Winbond SRAM not found

But when I use just the Caravel Nucleo (unplugging the STM32 Board), I get:

hugodg@hugo-pc:~/caravel_board/firmware/mpw2-5/blink$ sudo make clean flash
rm -f *.elf *.hex *.bin *.vvp *.vcd
#/usr/bin/riscv32-unknown-elf-gcc -O0 -march=rv32i_zicsr -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o blink.elf ../start.s ../print_io.c blink.c
/usr/bin/riscv64-unknown-elf-gcc -I../ -I../generated/ -O0 -mabi=ilp32 -march=rv32i -D__vexriscv__ -Wl,-Bstatic,-T,../sections.lds,--strip-debug -ffreestanding -nostdlib -o blink.elf ../crt0_vex.S ../isr.c blink.c
/usr/bin/riscv64-unknown-elf-objdump -D blink.elf > blink.lst
/usr/bin/riscv64-unknown-elf-objcopy -O verilog blink.elf blink.hex
sed -i'.orig' -e 's/@1000/@0000/g' blink.hex
python3 ../util/caravel_hkflash.py blink.hex
Success: Found one matching FTDI device at ftdi://ftdi:232h:1:7/1

Caravel data:
   mfg        = 0456
   product    = 11
   project ID = 00051890

Resetting Flash...
status = 0x00

JEDEC = b'ef4016'
Erasing chip...
done
status = 0x0
setting address to 0x0
addr 0x0: flash page write successful
addr 0x100: flash page write successful
addr 0x200: flash page write successful
addr 0x300: flash page write successful
addr 0x400: flash page write successful
addr 0x500: flash page write successful
addr 0x600: flash page write successful
addr 0x700: flash page write successful

total_bytes = 2048
status reg_1 = 0x0
status reg_2 = 0x2
************************************
verifying...
************************************
status reg_1 = 0x0
status reg_2 = 0x2
setting address to 0x0
addr 0x0: *** read compare FAILED ***
b'6f00000b13000000130000001300000013000000130000001300000013000000232e11fe232c51fe232a61fe232871fe2326a1fe2324b1fe2322c1fe2320d1fe232ee1fc232cf1fc232a01fd232811fd2326c1fd2324d1fd2322e1fd2320f1fd130101fcef0000118320c1038322810303234103832301030325c1028325810203264102832601020327c101832781010328410183280101032ec100832e8100032f4100832f0100130101047300203013010040170500001305c5f67310553013050000930500001706000013068673630cb500832606002320d50013054500130646006ff0dffe13050000930580006308b50023200500130545006ff05fff'
<----->
b'6f00000b13000000130000001300000013000000130000001300000013000000232e11fe232c55fe232e65fe232875fe23aeedfe23acbdfe23aeedfe23e9fdfe6beffdfe6bedfffe6fefffff6fefffff6fffffff6fffffff6fffffff7fffffff7ffdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x100: *** read compare FAILED ***
b'371500001305058873104530ef0000256f000000130101ff2326810013040101130000000324c1001301010167800000130101ff2326810013040101130000000324c1001301010167800000130101fe232e8100130401022326a4fe8327c4fe739007bc130000000324c1011301010267800000130101ff23261100232481001304010113050000eff05ffcb75700f09387c70123a00700b75700f09387c7001307100023a0e700b75700f09387070183a7070063980700130710002310e0006f008001b75700f09387c7011307100023a0e700130000008320c100032481001301010167800000130101ff2326810013040101130000000324c10013010101'
<----->
b'371500001305058873104530ef0014096f000008130101ff2327811a13048101130404000324c500130dcd0167898c0877898dff33afadfb7beded1b5bcded9b5fedef9a7fedef9b7fcdefbb7fddeffe7fffefff7fffffff7fffffffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x200: *** read compare FAILED ***
b'67800000130101ff2326810013040101130000000324c1001301010167800000130101fe232e8100130401022326a4feb75700f09387870023a00700b75700f00327c4fe23a0e700b75700f0938787001307100023a0e700b75700f09387c7001307100023a0e7006f004001b75700f09387c7001307100023a0e700b75700f09387070183a70700e39207fe13000000130000000324c1011301010267800000130101fe232e1100232c81001304010293070500a307f4fe0347f4fe9307a0006316f7001305d000eff09ffd13000000b76700f09387478003a7070093071000e308f7feb76700f0938707800347f4fe23a0e700130000008320c10103248101'
<----->
b'67800000538101ff2327819a33048501138c0c0003accd0813adcd0b7789ad1b77c9adfe7befeffe7fefef9a7fefeffeffffeffeffdfeffaffffefffffffffffffffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x300: *** read compare FAILED ***
b'1301010267800000130101fe232e1100232c8100130401022326a4fe6f00c0018327c4fe138717002326e4fe83c7070013850700eff0dff68327c4fe83c70700e39007fe13000000130000008320c101032481011301010267800000130101ff232611002324810013040101b73700f0938707801307100023a0e700b73700f09387478023a00700b73700f0938787801307100023a0e700b73700f09387c7801307100023a0e700b70700269387870b372700001307978023a0e700b70700269387470b372700001307978023a0e700b70700269387070b372700001307978023a0e700b70700269387c70a372700001307978023a0e700b70700269387870a'
<----->
b'13850735eff5dff1ffc7ccb63707e40223ade700b7cfee0037cd8f3deffddffbffffeffe7fcfecbe7bedef9affefef9affcfefbffffdfffffffdfffffffdefbbfffdffff7ffdffff7fffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x400: *** read compare FAILED ***
b'372700001307978023a0e700b70700269387470a372700001307978023a0e700b70700269387070a371700001307370023a0e700b70700269387c709371700001307370023a0e700b707002693878709371700001307370023a0e700b707002693874709371700001307370023a0e700b707002693870709371700001307370023a0e700b70700269387c708371700001307370023a0e700b707002693878708371700001307370023a0e700b707002693874708371700001307370023a0e700b707002693870708371700001307370023a0e700b70700269387c707371700001307370023a0e700b707002693878707371700001307370023a0e700b7070026'
<----->
b'b707002623a0e700b7c7e40013c50735eff51ff17fc70e808327c4feb38fff9aa3cfef0813cf8f1bb7cfaf3f3fedef3affefef9a7fcfefbffffdffffeffffffeffeffffefffffffe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x500: *** read compare FAILED ***
b'93874707371700001307370023a0e700b707002693870707371700001307370023a0e700b70700269387c706371700001307370023a0e700b707002693878706371700001307370023a0e700b707002693874706371700001307370023a0e700b707002693870706371700001307370023a0e700b70700269387c705371700001307370023a0e700b707002693878705371700001307370023a0e700b707002693874705371700001307370023a0e700b707002693870705371700001307370023a0e700b70700269387c704371700001307370023a0e700b707002693878704371700001307370023a0e700b707002693874704371700001307370023a0e700'
<----->
b'2326f4feb70700269387070103a7070083a7c4feb377f7082364f4feb707e43e9387070303a786fe23a5e79ab7dfef0037dd8f09effd9ffbffff8fffb78faf3bdbefef1b6bedfffeefeffefe5fefeffeffefefbeffcfefbfffffeffbffffeffaffffeffffffdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x600: *** read compare FAILED ***
b'b707002693870704371700001307370023a0e700b70700269387c703372700001307978023a0e700b707002693878703371700001307370023a0e700b707002693874703371700001307370023a0e700b707002693870703371700001307370023a0e700b70700269387c702371700001307370023a0e700b707002693878702372700001307978023a0e700b70700261307100023a0e70013000000b707002603a7070093071000e30af7feb73700f0938747811307100023a0e700b70700269387c70023a00700b70700269387070123a00700b7177a0013850720eff05fb4b73700f09387478123a00700b7070026938707011307f00323a0e700b7070026'
<----->
b'232c04fcb70700269387c70003a70700832744feb377f7082326f4fe1305a41aeff1fff5ffc7ccb6b787c70203a7c70083af46feb3ffffba23fffffc23afecff83afecff6bedfffaebeffffedbeffffe7feffffeefeffeffefefffff6ffffffeffffeffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'
addr 0x700: *** read compare FAILED ***
b'9387c7001307f0ff23a0e700b7177a0013850720eff0dfb06ff05ff9000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
<----->
b'37ffefff7fffffff7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'

total_bytes = 2048
pll_trim = b'09'

rm blink.elf
hugodiasg commented 3 months ago

I changed the USB cable of the STM32 Nucleo Board to a higher quality one and it works