I tried call "spiSend(&SPID4, 1, &data);" from shell command function, but it does not work.
Code: Select all
static void cmd_spitest(BaseSequentialStream *chp, int argc, char *argv[]) {
uint8_t data = 0x0b;
spiSelect(&SPID4);
spiSend(&SPID4, 1, &data);
spiUnselect(&SPID4);
}
I noticed that it works if I rewrite shell to static thread initialization.
Static shell initialization
Dynamic shell initialization
It sends 0x55, it's value for fill free space in thread stack, so it's definitely problem with pointer. See attachement with debug, there is right variable address in each step, M0AR register is set to right address to.
I have no clue what can be wrong. It seems that DMA cna't access to address, is it possible?
--------------------------------------------------------------------
Test 1:
* Latest CHibiOs from github
* STM32F764Zi nucleo 144
1) compiled by CMAKE (gcc-arm-none-eabi-10-2020-q4-major)
2) compiled by MAKE (usedMakefile from chibios Demo, default gcc flags) (start_gcc90)
SPI does not work from dynamic created shell
-------
Test 2:
* Latest ChibiOs from github
* STM32F401RE nucleo
1) compiled by CMAKE (gcc-arm-none-eabi-10-2020-q4-major)
2) compiled by MAKE (usedMakefile from chibios Demo, default gcc flags) (start_gcc90)
SPI works from dynamic created shell