about Sidekick - and its level of knowledge
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:
3. Zusammenfassung
Um auf dem STM32H743 einen SPI-Transfer durch Schreiben auf SPI_TXDR zu starten, müssen Sie:
- Die Datenlänge im SPI_CFG1-Register korrekt einstellen,
- die Bitreihenfolge im SPI_CFG2-Register wählen,
- die relevanten GPIOs konfigurieren,
- das SPI-Modul aktivieren,
- und dann die Daten in der konfigurierten Länge auf SPI_TXDR schreiben.
Ein Schreibzugriff mit weniger als der konfigurierten Datenlänge ist nicht zulässig.
--- 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.