No serial IF on openinverter running on Nucleo F103RB

Post Reply
danjulio
Posts: 31
Joined: Mon Apr 14, 2025 12:21 am
Has thanked: 86 times
Been thanked: 4 times

No serial IF on openinverter running on Nucleo F103RB

Post by danjulio »

I am interested in playing with the openinverter FW with an eye towards using it for my friend's LDU based Porsche conversion. To that end I decided to just get some experience with the code and have tried to load it on a Nucleo-F103RB board. I am using the current (as of Dec 7 2026 dowloaded from here) bootloader (@08000000) and stm32_sine firmware (@0x08001000). I attached an LED to PC12 and USB Serial port to PB10 (TX -> USB Serial RX) / PB11 (RX -> USB Serial TX) and a terminal emulator running at 115200 8N2 (or 8N1).

The LED flashes and I see "2D" printed in the terminal. However I don't seem to be able to enter any commands (e.g. "json").

I saw in another post Johannes said the serial interface should be functional no-matter the state of any inputs. I realize this isn't much to go on but I'm wondering if I'm missing some other setup I need to do. Any pointers appreciated.
User avatar
uhi22
Posts: 1244
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 244 times
Been thanked: 684 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by uhi22 »

In a completely different project but also with STM32 I had the issue that the software is blocking because of missing CAN transceiver. Solved by adding a bridge from CANRX to CANTX.
User avatar
manny
Posts: 195
Joined: Sun Jan 23, 2022 4:15 pm
Location: Netherlands
Has thanked: 58 times
Been thanked: 159 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by manny »

I also used the nucleo board to get started. I remember the there were some pins that needed modification. To get it running
[DRIVING] Citroen Saxo electrique
  • Volvo ERAD motor, XC90 inverter/DCDC (custom OI board)
  • PSA battery (50kWh)
  • Foccci and MG ZS charger 6.6kW
  • Zombie VCU
User avatar
johu
Site Admin
Posts: 7182
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 552 times
Been thanked: 1913 times
Contact:

Re: No serial IF on openinverter running on Nucleo F103RB

Post by johu »

The bootloader uses the internal oscillator while the firmware template expects an external 8 MHz crystal. Maybe that doesn't match?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
danjulio
Posts: 31
Joined: Mon Apr 14, 2025 12:21 am
Has thanked: 86 times
Been thanked: 4 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by danjulio »

Thanks for the responses. Here's what I've done based on them, but unfortunately still no-go.

1. I tied CAN_TX (PA12) to CAN_RX (PA11)
2. I tied MPROT (PA3) to 3V3 based on Johannes's HW Rev 3 Wiki page (to be unused)
3. I tied the now REServed input, previously EMCYSTOP, (PC7) to 3V3 also based on Johannes's HW Rev 3 Wiki page
4. I tied ERR/DeSAT (PC9) to 3V3 so it won't be floating (I'm trying to get the detect_hw() routine to return HW_REV3 (since that was the first schematic I found)
5. I tied CRUISE (PB5) to GND for the same reason (HW_REV3)

I initially worried about the clock input but the built-in ST-LINK programmer is supplying 8 MHz to the PH0-OSC_IN pin. I think the code is running because a LED attached to PC13 is blinking at 5 Hz (100 mSec on/100 mSec off).

I'm going to try to build the firmware and load it and put some printf's (Send("xxx")) early on to see where it stops running.
danjulio
Posts: 31
Joined: Mon Apr 14, 2025 12:21 am
Has thanked: 86 times
Been thanked: 4 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by danjulio »

OK, it's running! I think I must have damaged PB11 (USART3 RX) and that's why the serial IF doesn't work. I was able to print things from within the code (thanks for implementing putchar() so printf works!). This lead me to try the CAN interface with Dave's Openinverter CAN tool which worked straight away.

I'm excited to try this on a motor! But a bit intimidated still by all the parameters. Gonna recommend my friend buy a Tesla openinverter board. Do you ship to the USA?
User avatar
johu
Site Admin
Posts: 7182
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 552 times
Been thanked: 1913 times
Contact:

Re: No serial IF on openinverter running on Nucleo F103RB

Post by johu »

Great!

I recently did some test shipments to the US. One with regular DHL and one with Express. The DHL one is still in transit, the Express is somewhat ambiguous. First it said it was delivered and then it jumped back to "on hold".
Will clarify the situation before sending another shipment and report back here.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 7182
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 552 times
Been thanked: 1913 times
Contact:

Re: No serial IF on openinverter running on Nucleo F103RB

Post by johu »

Alright, the Express parcel was confirmed to have arrived, so that seems a safe option. Costs 81€ though.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
danjulio
Posts: 31
Joined: Mon Apr 14, 2025 12:21 am
Has thanked: 86 times
Been thanked: 4 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by danjulio »

OK, thank you. I'm going to see him today and we'll chat about changing from a commercial ($$$) VCU to Openinverter.

I tried to move to USART2 but no go, not even my "hello world" printf at the beginning of time. Here's what I did to re-arrange the GPIOs. Am I missing anything obvious?

1. In stm32_sine.cpp: Terminal t(USART2, TermCmds);
2. Looks like it's set to use PA2 for TX, and PA3 for RX. So re-arranged some GPIOs as follows
3. In ain_prj.h: Changed ANA_IN_ENTRY(uaux, GPIOA, 3) to ANA_IN_ENTRY(uaux, GPIOC, 5)
4. In digio_prj.h: Changed DIG_IO_ENTRY(brake_in, GPIOA, GPIO2, PinMode::INPUT_FLT) to DIG_IO_ENTRY(brake_in, GPIOC, GPIO4, PinMode::INPUT_FLT)
5. In digio_prj.h: Changed DIG_IO_ENTRY(mprot_in, GPIOA, GPIO3, PinMode::INPUT_PU) to DIG_IO_ENTRY(mprot_in, GPIOC, GPIO5, PinMode::INPUT_PU)

No worries if there's nothing obvious and it's a pain to think about.
User avatar
johu
Site Admin
Posts: 7182
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 552 times
Been thanked: 1913 times
Contact:

Re: No serial IF on openinverter running on Nucleo F103RB

Post by johu »

Probably need to enable the USART2 clock in hwinit.cpp clock_setup()
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
danjulio
Posts: 31
Joined: Mon Apr 14, 2025 12:21 am
Has thanked: 86 times
Been thanked: 4 times

Re: No serial IF on openinverter running on Nucleo F103RB

Post by danjulio »

oh, of course! But that didn't fix it either. No worries though. I'll keep digging as time permits. I want to learn these code bases.

I was mistaken. My friend put a SDU in his car. But, even with the known issues of openinverter in the SDU, he's game to try it. We'll probably buy in the US from Westside EV. I guess some of that money makes it back your way? Definitely want to support you.
Post Reply