tinyfpga / TinyFPGA-BX

Other
268 stars 96 forks source link

picosoc example linker script problems #13

Closed mattvenn closed 5 years ago

mattvenn commented 5 years ago

If you checkout the ws2812 branch of my fork here: https://github.com/mattvenn/TinyFPGA-BX/tree/ws2812 And then simulate:

make sim

You will see serial output and then gtkwave will start. At 359us, the LED register is written. This also works on the hardware.

Example 1: Global variables are unintialised.

In firmware.c, #define BREAK1

make sim

Serial never gets beyond the Booting, and at 305us the LED register is written with XXXXXX

Example 2: Can't program tinyfpga.

In firmware.c #define BREAK2

make sim

simulates correctly, but tinyfpga fails to program:

matt-pc:2216 [ws2812]: make 
tinyprog -p hardware.bin -u firmware.bin
/home/matt/.local/lib/python2.7/site-packages/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)

    TinyProg CLI
    ------------
    Using device id 1d50:6130
    Only one board with active bootloader, using it.
    Programming /dev/ttyACM1 with hardware.bin
    Programming at addr 028000
    Waking up SPI flash
    135100 bytes to program
    Erasing: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:00<00:00, 138kB/s]
    Writing: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:00<00:00, 177kB/s]
    Reading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 135k/135k [00:00<00:00, 430kB/s]
    Success!
    Programming /dev/ttyACM1 with firmware.bin
    Programming at addr 050000
    Waking up SPI flash
    3616 bytes to program
    Erasing: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.62k/3.62k [00:01<00:00, 3.42kB/s]
    Writing: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.62k/3.62k [00:00<00:00, 115kB/s]
    Reading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.62k/3.62k [00:00<00:00, 234kB/s]
    Failure!
Makefile:3: recipe for target 'upload' failed
make: *** [upload] Error 1
ruabmbua commented 5 years ago

I have the same problem. I managed to debug it. Seems like my flash got corrupted on address 0x050000. The readout is not equal to the written image... I will try to send the board back to the seller, and get a new one in exchange. Otherwise the tinyfpga was an amazing experience.

Has someone else had similar problems?

mattvenn commented 5 years ago

I forgot about this issue after I resolved it by changing the linker script. See this commit: https://github.com/mattvenn/TinyFPGA-BX/commit/b5d2e848f4e9dd0e0beb1729d488813bea5d6ca6