I have a project with an infineon/cypress psoc62 (CY8C624AAZI-S2D44). It is a dual core arm MCU (CM4 is Arm7 and CM0p is Arm6) . I'm using the CM4 core. The CM0p core releases the CM4 from reset and put itself to sleep. The MCU has two SD(Secure Digital)/eMMC peripherals (SDHC0 and SDHC1). I'm trying to use SDHC1 to see "activity" in the clk and cmd pins. SD specs are rather complex and I'm just trying to see what command is sending out to init the eMMC. I do not have an eMMC or SD card installed in my board yet. I'm using SDHC1 with base address 0x40470000. The autogenerated code for modustoolbox is throwing a "hardfault" according to the xPSR register (3 in lower bits) when trying to read address 0x4047152C. It looks like trying to read any register in that range generates a hardfault. I'm trying to learn about arm because I've never used them before. I'm using an empty dual core project so my code is very minimal. Basically I'm writting what in their PDL (Peripheral Device Library) example up to "Configure SD Host". I did not include the optional interrupt code. There is a macro (read-modify-write thingy) inside "(void) Cy_SD_Host_Init(SDHC1, &sdHostConfig, &sdHostContext);" that is throwing the hardfault.
The disassembly window showed me the code that it was generating for the macro that is throwing the hardfault. I found a simulator but it kept complaining about the value #1324. Immediate value loading looked really weird until I found an explanation and calculator here.
So I thought I found a bug in the autogenerated assembly code (picture below). But when I change it so the simulator didn't complaint ...I still get the hardfault when reading address 0x4047152C in modustoolbox. Oddly enough saving the value at that address works. I don't see any memory/peripheral protection code and from what I've read the peripheral memory at 0x40470000 doesn't have any restriction as default.
What else can I do or look into to try to figure out what's causing this hardfault?
Thanks