2026-05-22 11:59 AM
Just for fun...i tried to use the SPI on H743 by direct setting and writing to registers:
- i never got it working on some attempts years ago, so just used HAL , which just works.
- now i tried again: cannot be, its so difficult...
- ok, its a over complicated construction....old SPI on F303 works instantly and fast, no problem there.
- but now have AI ... can it help?
So i tried Sidekick, it should be easy for him...it...whatever...
I asked how to do...in German, more easy for me - and a test: can it understand...?
Sidekick tells:
Um auf dem STM32H743 einen SPI-Transfer durch Schreiben auf SPI_TXDR zu starten, müssen Sie:
--- THIS didnt help me, as it also just brings one SPI transfer, then never more any Tx.
So i asked the google machine, KI mode, same question:
c// 1. SPI Grundkonfiguration (SPE muss 0 sein während der Konfiguration)
SPI1->CR1 &= ~SPI_CR1_SPE;
SPI1->CFG1 |= (7 << SPI_CFG1_DSIZE_Pos); // 8-Bit Datenbreite (0x7 = 8-bit)
SPI1->CFG1 &= ~SPI_CFG1_TXDMAEN; // DMA deaktivieren (falls vorher aktiv)
// 2. TSIZE zwingend auf 0 setzen für Endlos-Modus
SPI1->CR2 &= ~SPI_CR2_TSIZE; // TSIZE = 0
// 3. SPI einschalten
SPI1->CR1 |= SPI_CR1_SPE;
// 4. Master-Transfer dauerhaft aktivieren
SPI1->CR1 |= SPI_CR1_CSTART;cvoid SPI_SendByte(uint8_t data) {
// Warten, bis der TX-FIFO bereit für neue Daten ist (TX-Packet space available)
while (!(SPI1->SR & SPI_SR_TXP));
// Daten mit exakter 8-Bit-Breite in das Register schreiben
*((__IO uint8_t *)&SPI1->TXDR) = data;
}And right, this was working , as its writing.
But the target, TFT, not happy with 400% more speed now, needs little delay between command and data,
so i asked for this feature:
cvoid ST7789_SendByte(uint8_t data) {
// 1. Warten, bis Platz im TX-FIFO ist
while (!(SPI1->SR & SPI_SR_TXP));
// 2. Byte schreiben
*((__IO uint8_t *)&SPI1->TXDR) = data;
// 3. Zwingend warten, bis das Byte komplett über die Pins gesendet wurde!
// TXC wird erst 1, wenn der TX-FIFO leer ist UND das Schieberegister fertig ist.
while (!(SPI1->SR & SPI_SR_TXC));
}--------------------------------------------
So comparing the level and quality of info/help, .......
well, the only good thing about this Sidekick thing is...that it has plenty of room for improvement.
Truly extremely disappointing.
2026-05-22 12:38 PM
Dear @AScha.3 ,
Thank you for the valuable feedback, indeed today we are not supporting inside Sidekick software code generation and answers are focused on MCU documentation and official from our web site. However, this feedback is important and will take into account for the roadmap and priorities with our teams .
Much appreciated.
STOne-32
2026-05-22 12:49 PM - edited 2026-05-22 12:50 PM
Hello,
As said by @STOne-32, today Sidekick is not intended to generate code or analyze it. It's only intended to help users to find information in the different documentations and this was stated in the Sidekick default prompt:
2026-05-22 2:12 PM
I didnt make a test...i just tried to get "help" with this strange complicated SPI , because no useful examples also.
Just see, what the Gemini /google answered, after i wrote: its working now:
It’s great that everything is running smoothly now! For displays like the ST7789, the combination of precisely waiting for the TXC flag and manually controlling the D/C and CS GPIOs is indeed the most stable solution. Since the software overhead involved in toggling the GPIOs briefly delays execution, the display controller receives exactly the minimal pause it requires for processing. However, if you later wish to transfer large amounts of data—such as entire images or framebuffers—to the display, waiting byte-by-byte within the loop will consume a significant amount of CPU time. If you decide to optimize this project in the future, we could tackle the following steps next: Block Transfers—sending large pixel arrays in a fast "Continuous Mode" (without pauses between bytes); and DMA Support—transferring the entire image buffer to the display in the background, thereby allowing your CPU to handle other tasks simultaneously. Would you like to optimize the transmission of image data (Burst Mode) next, or is the display already running fast enough for your current application?
--- too much for tonight, but ... can you feel some difference in level ?