-
-
Notifications
You must be signed in to change notification settings - Fork 34
UNO-Q: Fix SPI (spi2) - disable PWM on D11 #242
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
base: main
Are you sure you want to change the base?
Conversation
The MOSI pin was not working on SPI as the MOSI pin was coming up in AF mode 1 (i.e. timer). More details in the forum thread: https://forum.arduino.cc/t/spi-spi2-does-not-appear-to-work-add-spi1/1411662/3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the analysis and PR, Kurt!
We are working on a long term fix for the multiple pin assignments in the DTS. In the meantime, this is very welcome!
|
I read KurtE's analysis of the problem but don't know how to implement fix myself. When will this PR make it to distributed code? I just received my UnoQ and have been prompted for one complete image update and also several other updates (when I open App Lab). Since I also have this SPI problem, I am assuming fix has not been integrated yet. Thanks |
Until, this is pulled in, the only way to use it, is to rebuild the zephyr "bootloader". I don't know if you are running using Windows, or Ubuntu or the like: My setup is a bit more complicated as I mainly work on Windows, and there is not native build support for the ArduinoCore-zephyr under windows. There is a section that shows how a few of us do it, where we do the build under WSL (Windows Subsystem for Linux), I copy the stuff out to windows file system, and then I you can update the logical Bootloader, using the burn bootloader command... Again more details in the ReadMe. But keeping fingers crossed hopefully they will pull this one in soon and do another release. |
@pillo79 and all - I am guessing that you are all up to your eyebrows with getting things working and the like, which @bmillier - My first response is the right response... However if it were me, I might be tempted to try some simple hack and see That is if you start your sketch, you might try manually updating the MOSI pin to be in SPI mode. Not sure if it would Typed on the fly so could have issues. Look at the test sketch I showed in the forum thread linked to in first post |
|
@KurtE. Many thanks for your prompt attention to this bug. The line of code you quoted is something I understand- the Device Tree and re-building the bootloader for the ST MCU- not so much! While the code looked OK to me, it wouldn't compile and I had to change it to: While on the SPI topic, I note that the pinout diagram shows the SPI port on D10-D13 as using SPI2 and the 6-pin header (which used to be the SPI port for programming on the old M328 Uno boards) as also using SPI2. While this was true on the M328, I don't think it's correct here as there is no continuity between the D10-13 pins and the 6-pin header. I have to look into this some more. |
|
@KurtE: It wasn't the missing ; - I corrected that when pasting it into code. It was that I had to change I did find the hex and elf files for the bootloader while searching. |

The MOSI pin was not working on SPI (uses hardware spi2 object)
as the MOSI pin was coming up in AF mode 1 (i.e. timer).
Fixed it by commenting out the PWM information for that pin PB15
More details in the forum thread:
https://forum.arduino.cc/t/spi-spi2-does-not-appear-to-work-add-spi1/1411662/3