2022-07-28 12:42 PM
Hey guys I am having one issue, with the stm32f103 SPI peripheral. I have developed my SPI bare metal mode(spi_mast_tran_byte(), spi_mast_recv_byte() : see pitchers below) and w25q128 flash memory in which I am reading its JDEC ID which is at address 9F and JDEC ID is 0xEF4018( which can be seen on logic analyzer output). But when I read the JDEC ID with my code of W25q128 API ( W25_Read_ID()). what I am observing is that my first byte read from SPI is always 0xff, which should be instead 0x9f.
I am not able to get why on reading the spi slave every time the first byte read is 0xff, even though in logic analyzer it is showing something else.
I am guessing there is something with my SPI peripheral driver but not able to make out what exactly is the issue.
2022-07-28 12:58 PM
Your 2nd while loop in the receive function appears to be missing ;.
2022-07-28 03:05 PM
You have STM32 MCU not an MPU, will fix the tagging so this is in the right subforum.
Post code in an editable form, not screenshots/bitmaps, they are unworkable
Use the code posting tool, see </> icon below edit/post window.
2022-07-28 08:23 PM
As master, focus on rxne and not txe. They don't pop at the same time. Txe before transfer, rxne after transfer is completed. Use 4 wire bidir mode, don't try monodir at first.