AnsweredAssumed Answered

Configure Pins in MQX Task

Question asked by Adrian Rockall on Mar 24, 2015
Latest reply on Mar 25, 2015 by Adrian Rockall

Hi,

 

I have created an MQX + KSDK project for the IAR compiler using PEx. I have added an fsl_dspi component as spiCom2 and configured it and it all works well reading and writing to a 32Mbit flash memory. But in the final design the memory is used to program an FPGA at boot up so I only want the micro controller SPI pins to be programmed when the FPGA code is updated by the user and at all other times the SPI pins need to be inputs or tri-state.

I have switched off the auto-initialise option in the PinSettings component and this has satisfied the first requirement of keeping the pins disabled as configure_spi_pins is no longer called in hardware_init. However when I call configure_spi_pins from my FPGA_update task it causes the HardFault_Handler to be called as soon as PORT_HAL_SetMuxMode(PORTD_BASE,11u,kPortMuxAlt2); is called. This is the first time I have used an RTOS in an embedded design so I'm not sure why it is not working. I have checked that MQX_ENABLE_USER_MODE is set to 0 so I presume my task is priviledged enough but is there anything else I need to do?

 

Thanks for any assistance,
Adrian

Outcomes