Hello,
I am trying to port MbedOS v6.15.1 STM32H735G-DK,
I have followed this guide to port it,
I have generated PinNames.h and PeripheralPins.c automatically using XML file from CubeMX using the following command:
python STM32_gen_PeripheralPins.py -m "STM32H735IGKx.xml
Then I have changed the Px_x in PinNames to the following :
#define LED1 PC_3
#define LED2 PC_2
#define LED3 PF_7
#ifdef MBED_CONF_TARGET_STDIO_UART_TX
CONSOLE_TX = MBED_CONF_TARGET_STDIO_UART_TX,
#else
CONSOLE_TX = PD_8,
#endif
#ifdef MBED_CONF_TARGET_STDIO_UART_RX
CONSOLE_RX = MBED_CONF_TARGET_STDIO_UART_RX,
#else
CONSOLE_RX = PD_9,
#endif
I have inherited the board from MCU_STM32H735xG
and added a macro for "HSE_VALUE=25000000"
the full code is on this public GitHub repo
The important file that I think is wrong and making the below errors is system_clock.c
, I have compared the DIV (PPLx) from MbedTLS since it is already ported in the board, so the following lines are changed:
#if HSE_VALUE==25000000
RCC_OscInitStruct.PLL.PLLM = 5; // 2 MHz
RCC_OscInitStruct.PLL.PLLN = 104; // 550 MHz
#else
#error Unsupported externall clock value, check HSE_VALUE define
#endif
RCC_OscInitStruct.PLL.PLLP = 1;
RCC_OscInitStruct.PLL.PLLQ = 4;
RCC_OscInitStruct.PLL.PLLR = 2;
RCC_OscInitStruct.PLL.PLLFRACN = 0;
RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOWIDE;
RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2;
Result: It compiles correctly, it loads the bin file but not completely, and put the board in a deadlock( If the board SMPS/LDO firmware PWR configuration does not match its hardware configuration, a deadlock occurs. After the reset, the ST-LINK cannot connect to the target anymore
.) , so I had to do a Mass reset to work with it again, the error is as follow:
0001125:CRITICAL:main:STLink error (9): Get IDCODE error
Traceback (most recent call last):
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/main.py”, line 402, in run
self._COMMANDSself._args.cmd
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/main.py”, line 572, in do_flash
with session:
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/session.py”, line 339, in enter
self.open()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/session.py”, line 457, in open
self._board.init()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/board/board.py”, line 85, in init
self.target.init()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/core/soc_target.py”, line 117, in init
seq.invoke()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/sequencer.py”, line 213, in invoke
resultSequence.invoke()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/utility/sequencer.py”, line 208, in invoke
resultSequence = call()
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/dap.py”, line 376, in _connect
connector.connect(self._protocol)
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/dap.py”, line 163, in connect
self._connect_probe(protocol)
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/coresight/dap.py”, line 183, in _connect_probe
self._probe.connect(protocol)
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/stlink_probe.py”, line 136, in connect
self._link.enter_debug(STLink.Protocol.SWD)
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/stlink/stlink.py”, line 267, in enter_debug
self._check_status(response)
File “/Library/Application Support/Mbed Studio/mbed-studio-tools/python/lib/python3.7/site-packages/pyocd/probe/stlink/stlink.py”, line 305, in _check_status
raise exceptions.ProbeError(error_message)
pyocd.core.exceptions.ProbeError: STLink error (9): Get IDCODE error