-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Missing SPI SCK on STM32F103vctx #43452
Comments
when remapping the SPI1 (REMAP_1), I suspect a pin conflict between SPI1 and DEBUG pins --> if SPI1 is remapped then it is needed to |
Thanks for your update. We had a further look into that and found the config option |
Do you get the same issue even when not using SPI1 at all (eg: hello_world)? |
@erwango, yes. When
The board is connected via SWD using ST-LINK/V2. ST-Link/V2 firmware version: Connection of ST-Link/V2 to MCU:
What works
What doesn't workNot able to debug and run Zephyr application when Tried different OpenOCD binaries:
With different configurations:
Every configuration hangs within the aforementioned SWDWithout
|
Found a fix. Every
The
The reference manual (RM0008) doesn't say why such configuration has to be applied when setting the remap value. From the reference manual, page 184:
After the following modification in
the board can be debugged and SPI 1 SCK signal is present. The SPI will be revalidate, then PR will be created. |
@GeorgeCGV Thanks for the investigation and finding the issue! |
The PR is created. I can confirm that the SPI 1 SCK signal is present on PB3. Some notes: HAL and LL don't disable the There is a difference in the order of how SWJ and remap are being set between HAL and LL:
Unfortunately, we didn't manage to communicate with the external IC over the SPI 1 on F1VC in Zephyr yet. |
Everything works now. What helped is the usage of Unfortunately, it is unknown why setting the For example:
The SWJ initialization is moved into I don't think that we shall get rid of the The PR also follows your suggestion regarding the DTS usage instead of Kconfig for the SWJ. That makes more sense, as it is a setting that is more or less F1-specific. |
Describe the bug
A custom board using stm32F103vctx MCU uses SPI1 with remaped sck pin pb3 does not output any clock signal. The SPI1 peripheral was used and configured with the stm vendor dts / dtsi. However once I tried to sent out some SPI commands using the stm spi driver I noticed that no spi clock signal is emitted on pb3 (using an oscilloscope). The other spi signals (MOSI, MISO and nCS on pb4, pb5 and pb8) are correctly pushed by the stm spi driver.
A quick implementation using only STM HAL produces the same register contents of the affected register banks GPIOB, AFIO, and SPI1. However using STM HAL the clock signal is emitted correctly on pb3.
To Reproduce
Steps to reproduce the behavior:
pinctrl-0 = <&spi1_sck_master_pb3 &spi1_miso_master_pb4 &spi1_mosi_master_pb5>; cs-gpios = <&gpiob 8 (GPIO_ACTIVE_LOW)>; pinctrl-names = "default"; status = "ok";
spi_transceive_dt
Expected behavior
SPI communication with remapped Pins pb3, pb4 and pb5 is working
Impact
In that case no SPI communication can be established which is a show stopper on my board right now.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: