SWD lost when accessing NAND via FMC
Hello. I am working with a STM32H563IIKX, connected to an external Macronix MX30LF2G28AD NAND Flash chip. I have configured the FMC for NAND operation with what I think are correct parameters (this is completely new to me).
I thought I'd try a very simple test to see if communication with the external NAND is working at all. After all of the auto-generated MX_xxxx_Init() calls in main(), I added this:
NAND_IDTypeDef nandID = { 0 };
HAL_StatusTypeDef nand_rc = HAL_NAND_Read_ID(&hnand1, &nandID);
Once I "step over" the call to HAL_NAND_Read_ID, SWD loses connection ("Target is not responding, retrying..." until it gives up).
If I step into HAL_NAND_Read_ID, SWD is lost specifically at this line:
data = *(__IO uint32_t *)deviceaddress;
Is this expected behavior? Is SWD somehow incompatible with FMC-NAND? Or is this possibly just an indication that my NAND parameters (or wiring) is wrong? What other information should I provide to help diagnose this?
