We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
How about making GPIO only accessible from safety code?
We are working with an ARM926EJS core (netX500 from Hilscher). For a safety application, I need to guarantee, that only safety code (written according to special coding guidelines and 100% tested) can set special GPIOs.To separate the "standard" GPIOs from the "safety" GPIOs, I cannot use the MMU, as the MMU tables can only be programmed in steps of 1kB.Therefore, I got the idea to use the debug unit. When standard code is run, there would be a watchpoint which will react, if standard code wants to set safety GPIOs.
How would you do this? My only idea is to protect the whole area, where the GPIOs are located, by MMU. An access will generate a data abort and I can then decide, if the access is ok.But, I don't know in detail at the moment, what information the data abort gives me.I have the adress of the instruction, which caused it in R14.But then, I need to analyze this instruction in order to know, which register should be written to the adress.
The problem with writing a separate API is, that the non-safe code is already there (CANOpen stack, operating system, ...). We are using the free FIQ interrupt to add our safety code in time-multiplex. Therefore, the CANOpen stack for example uses the API of the standard operating system... No way to add my own API with little effort...