Page 1 of 1

No serial IF on openinverter running on Nucleo F103RB

Posted: Fri Jan 30, 2026 12:07 am
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.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Fri Jan 30, 2026 6:58 am
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.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Fri Jan 30, 2026 7:29 am
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

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Fri Jan 30, 2026 5:28 pm
by johu
The bootloader uses the internal oscillator while the firmware template expects an external 8 MHz crystal. Maybe that doesn't match?

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Fri Jan 30, 2026 7:28 pm
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.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sat Jan 31, 2026 4:43 am
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?

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sat Jan 31, 2026 7:53 am
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.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sat Jan 31, 2026 6:36 pm
by johu
Alright, the Express parcel was confirmed to have arrived, so that seems a safe option. Costs 81€ though.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sat Jan 31, 2026 7:21 pm
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.

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sat Jan 31, 2026 8:11 pm
by johu
Probably need to enable the USART2 clock in hwinit.cpp clock_setup()

Re: No serial IF on openinverter running on Nucleo F103RB

Posted: Sun Feb 01, 2026 4:01 pm
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.