stm32_sine compiling with MacOS

Post Reply
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

stm32_sine compiling with MacOS

Post by mane2 »

I just installed arm libraries using

Code: Select all

brew install gcc-arm-none-eabi gcc-arm-embedded
and executed

Code: Select all

make get-deps
, then

Code: Select all

make
All worked out, it compiled successfully and I have new stm32_sine.bin file to flash.

Change I did was to remove the error complaining about not flashing when opmode is running, due my wiring.

Now I’m wondering, do I dear to flash that firmware. Is there some differences between OSes that could cause flashing to fail or some other errors? (Instructions on web talk about Ubuntu.)
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

Re: stm32_sine compiling with MacOS

Post by mane2 »

What if flashing fails, can I upload another binary file, or is the stm32 only recoverable with st-link or some other way that requires pulling the motor and card out?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: stm32_sine compiling with MacOS

Post by Pete9008 »

Personally I'd change your wiring rather than bypass the protections - they are there for a reason! Unless you know what you are doing and are very careful there is potential to damage the inverter!
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

Re: stm32_sine compiling with MacOS

Post by mane2 »

Ok. I actually already added a switch, to not send run-signal to PIN23 when I start the inverter for tweaking. Now I'm mostly curious what would happen if I would flash it and it would fail. Is it recoverable without removing motor and card?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: stm32_sine compiling with MacOS

Post by Pete9008 »

As long as you don't remove the bootloader it should be possible to recover but not guaranteed. People have bought out the stlink connections too in the past, just in case!

When writing to flash the code execution actually stops for a while so having the inverter in run mode while doing it is a bad idea!
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

Re: stm32_sine compiling with MacOS

Post by mane2 »

Ok, good to hear.

In my case, the wifi-signal is so bad that I need to be inside the trunk to do anything. So even though opmode=running, inverter does nothing :)
User avatar
mane2
Posts: 177
Joined: Fri Jan 13, 2023 6:32 am
Location: Finland
Has thanked: 20 times
Been thanked: 8 times

Re: stm32_sine compiling with MacOS

Post by mane2 »

Forgot to update this topic. I made a small change to firmware and used web interface to upload it to SDU. After that, no parameters etc shown. So something went wrong. Need to pull it apart and flash with ST-link it seems. I did buy that stlink though before doing this. And did that software update to another motor that is not attached to actual car. But word of caution, there seems to be something different with builds made with Linux and Mac, causing mac-builds to be incompatible.
Post Reply