esl-epfl / x-heep

eXtendable Heterogeneous Energy-Efficient Platform based on RISC-V
Other
129 stars 69 forks source link

Edit variable declaration in makefile #506

Closed LuigiGiuffrida98 closed 1 month ago

LuigiGiuffrida98 commented 1 month ago

When running targets that use the MAX_HEX_ADDRESS, MAX_HEX_ADDRESS_DEC, BYTES_AFTER_MAX_HEX_ADDRESS and FLASHWRITE_BYTES variables of the makefile some faulty output is generated:

/bin/sh: line 1: printf: 0x: invalid hex number
/bin/sh: line 1: printf: 0x: invalid hex number
/bin/sh: line 1: printf: 0x: invalid hex number
/bin/sh: line 1: printf: 0x: invalid hex number

Since these variables are defined with the = they are evaluated at run time and for some strange reason are not evaluated correctly.

Defining these variables with :=, so being evaluated at declaration time, seems to solve this issue.

Noticed a type in the name of one of the variable too, I fixed this too.

:warning: :warning: :warning: :warning: :warning: :warning:
This can be something related to my specific system configuration, so the solution can be different on a different system. So, please, someone with a different configuration can doublecheck that this is working? (@JuanSapriza @JoseCalero :pray: )

Steps to reproduce and check if everything is fine:

make app
make flash-prog

It is not necessary to connect the programmer to the computer, since it is not relevant what iceprog thinks.

JuanSapriza commented 1 month ago

You sure it aint necessary to connect a programmer? I tried both main and this branch and always get stucked in:

(core-v-mini-mcu) juan@7430:~/Desktop/ESL/0_x-heep$ make flash-prog
$You are executing from: /home/juan/Desktop/ESL/0_x-heep
USING MINICONDA core-v-mini-mcu
cd sw/vendor/yosyshq_icestorm/iceprog; make; \
./iceprog -a 52396 -d i:0x0403:0x6011 -I B /home/juan/Desktop/ESL/0_x-heep/sw/build/main.hex;
make[1]: Entering directory '/home/juan/Desktop/ESL/0_x-heep/sw/vendor/yosyshq_icestorm/iceprog'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/juan/Desktop/ESL/0_x-heep/sw/vendor/yosyshq_icestorm/iceprog'
init..
Can't find iCE FTDI USB device (device string i:0x0403:0x6011).
ABORT.
make: *** [Makefile:262: flash-prog] Error 2

I am guessing the issue is shown in a later stage?

LuigiGiuffrida98 commented 1 month ago

In the main I have the issue even without the programmer

JuanSapriza commented 1 month ago

What is the output you see?

JuanSapriza commented 1 month ago

@JoseCalero: I just talked with Luigi. I cannot replicate the issue, but his fix does not break anything on my set-up. For me it's good

JoseCalero commented 1 month ago

for me it is good as well @LuigiGiuffrida98 and @JuanSapriza