Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging workflow #97

Merged
merged 6 commits into from
Jul 3, 2024
Merged

Debugging workflow #97

merged 6 commits into from
Jul 3, 2024

Conversation

dzid26
Copy link

@dzid26 dzid26 commented Jun 5, 2024

  • build ELF
  • debug in vscode (ctrl+shift+b or F5)
  • copy main.hex to root

Ctrl+shift+b:
image
F5:
image

@dzid26 dzid26 force-pushed the debugging branch 7 times, most recently from 68ac511 to 6fe5aeb Compare June 5, 2024 11:52
@emmebrusa
Copy link
Owner

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
Copy link
Owner

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

@dzid26 dzid26 force-pushed the debugging branch 2 times, most recently from 1917e9c to 180ee5b Compare June 21, 2024 18:24
@emmebrusa
Copy link
Owner

emmebrusa commented Jun 22, 2024

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 dzid26 force-pushed the debugging branch 2 times, most recently from 8584103 to 5687fac Compare June 23, 2024 13:35
@dzid26
Copy link
Author

dzid26 commented Jun 23, 2024

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
Copy link
Author

dzid26 commented Jun 23, 2024

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

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

@emmebrusa
Copy link
Owner

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

dzid26 added 4 commits June 25, 2024 14:18
copy main.hex to the root for the convenience
Flashing tips

Use hex extension instead of ihx
copy main.hex to the root for the convenience
@dzid26 dzid26 marked this pull request as ready for review June 25, 2024 13:48
@dzid26
Copy link
Author

dzid26 commented Jun 25, 2024

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

@emmebrusa
Copy link
Owner

Yes, it works on Win10 64bit.

@emmebrusa emmebrusa merged commit d1e0bdc into emmebrusa:master Jul 3, 2024
3 checks passed
@emmebrusa
Copy link
Owner

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

@dzid26 dzid26 deleted the debugging branch July 4, 2024 08:12
@dzid26
Copy link
Author

dzid26 commented Jul 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants