emmebrusa / TSDZ2-Smart-EBike-1

TSDZ2 Open Source Firmware adapted to VLCD5-VLCD6-XH18 displays
GNU General Public License v3.0
131 stars 35 forks source link

Debugging workflow #97

Closed dzid26 closed 1 week ago

dzid26 commented 1 month ago

Ctrl+shift+b: image F5: image

emmebrusa commented 1 month ago

I was publishing the new version and saw your pull request. They are not tools that I use, but if you think they can be useful, no problem integrating them. The only exception are the changes to motor.c, in the new version I found that a few lines of code more or less can change the response of the motor, it is necessary to repeat the efficiency tests. I will, but it won't be anytime soon.

emmebrusa commented 1 month ago

I think it's better to release the new version, so you can verify if the proposed changes need to be updated.

emmebrusa commented 2 weeks ago

Build elf. What is this commit for? Is it really necessary? Requires the installation of msys64 or at least some missing dlls. What about 32-bit systems?

It also gives me an error during build: File_not_found

dzid26 commented 2 weeks ago

Building elf that contain symbol names is what allows debugging or importing variable addresses to STMstudio.

The issue is with the objcopy that is used to convert elf to hex (for flashing). I am not sure why the binary that I included doesn't work for you but works in the CI without dlls.

But the error itself is actually probably just missing cp command

dzid26 commented 2 weeks ago

I added cp.cmd file for Windows. Does this work now for you?

Does objcopy.exe indeed need a dll as you mentioned?

emmebrusa commented 2 weeks ago

Same problem: "cannot find file". Only the error number changes, instead of "make: [main] Error 2" it is now "make: [main] Error 1".

dzid26 commented 2 weeks ago

This was so annoying to test..... But I think it should work now. On 32bit and 64bit.

emmebrusa commented 1 week ago

Yes, it works on Win10 64bit.

emmebrusa commented 6 days ago

One question, why did you copy main.exe to the main folder?

dzid26 commented 6 days ago

main.hex copying to the root is mainly for the convenience.

I am not sure if others will benefit, but I often save the binary with a meaningful name. Searching for it everytime in the bin folder was cumbersome.

I then often wirelessly transfer the hex file to android phone and flash it, as described now in the second bullet here https://github.com/emmebrusa/TSDZ2-Smart-EBike-1#flashing-the-firmware-manually.