Jun 25, 2021
12:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 25, 2021
12:15 AM
Hi all,
We are using the AURIX TC27xD for our project.
We have integrated the hitex SafeTlib and it works on Power-on, however after a Soft reset (System reset) we get the error "bus error generated by CPU".
This happens because of writing to the register "FLASH0_FCON".
So my question now is which registers do we need to set/reset to achieve writing on the FLASH0_FCON register successfully?
Thanks and best regards,
APeter
We are using the AURIX TC27xD for our project.
We have integrated the hitex SafeTlib and it works on Power-on, however after a Soft reset (System reset) we get the error "bus error generated by CPU".
This happens because of writing to the register "FLASH0_FCON".
So my question now is which registers do we need to set/reset to achieve writing on the FLASH0_FCON register successfully?
Thanks and best regards,
APeter
Solved! Go to Solution.
1 Solution
Jul 08, 2021
03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 08, 2021
03:54 AM
For anyone who encounters such a problem we are now able to write on the FLASH0_FCON register.
In the HtxStlIf.c file from hitex you can increase the value HTXSTLIF_FLASH_FCON_WSPFLASH from 2U to 4U and reset your RAM after a system reset.
Further information:
If you do not reset your RAM after a system reset is performed the Safety Endinit Semaphore will be set and you wouldn't be able to call the function Mcal_ResetSafetyENDINIT_Timed() succesfully as the spinlock is already aquired by another instance.
In the HtxStlIf.c file from hitex you can increase the value HTXSTLIF_FLASH_FCON_WSPFLASH from 2U to 4U and reset your RAM after a system reset.
Further information:
If you do not reset your RAM after a system reset is performed the Safety Endinit Semaphore will be set and you wouldn't be able to call the function Mcal_ResetSafetyENDINIT_Timed() succesfully as the spinlock is already aquired by another instance.
5 Replies
Jun 25, 2021
05:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 25, 2021
05:22 AM
Check out Table 10-19 Registers Overview on page 950 of tc27xD_um_v2.2.pdf: the "Access Mode" for writing to FCON says P, SV, E. The E here means that the register is ENDINIT protected.
To write to ENDINIT protected registers, you must unlock ENDINIT protection, do the write, and then relock. Something like this should work:
To write to ENDINIT protected registers, you must unlock ENDINIT protection, do the write, and then relock. Something like this should work:
Mcal_ResetENDINIT();
FLASH0_FCON.U = whatever;
Mcal_SetENDINIT();
Jun 27, 2021
10:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 27, 2021
10:52 PM
Thank you very much for your explanation UC_wrangler.
In the code it is already like you have described it above:
Mcal_ResetENDINIT();
FLASH0_FCON.U = whatever;
Mcal_SetENDINIT();
However I still can't write to this register. What else could be the cause of not writing to this register?
In the code it is already like you have described it above:
Mcal_ResetENDINIT();
FLASH0_FCON.U = whatever;
Mcal_SetENDINIT();
However I still can't write to this register. What else could be the cause of not writing to this register?
Jun 28, 2021
08:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 28, 2021
08:24 AM
Writing to the register also requires SV, or Supervisor mode. Is CPUx_PSW.IO=2?
Finally, the P means Access Protection applies. This would only be the case if you changed FLASH0_ACCEN0 from the default value of 0xFFFFFFFF (all bus masters allowed to write to FLASH registers).
Finally, the P means Access Protection applies. This would only be the case if you changed FLASH0_ACCEN0 from the default value of 0xFFFFFFFF (all bus masters allowed to write to FLASH registers).
Jun 29, 2021
12:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 29, 2021
12:22 AM
I checked the register CPU0_PSW and the register value CPU0_PSW.IO = 2
Also checked the FLASH0_ACCEN0 register and its value is 0xFFFFFFFF
Further information:
SCU_CCUCON0 at Power On Reset its Register Value is 0x01120148 and after a System Reset it is 0x12120112
The register values (fFSI2 and fSRI) aren't changed.
ENDINIT bit is cleared by Mcal_ResetENDINIT() -> Register value WDTCPU0CON0 is 0xFFFC000E before writing to FLASH0_FCON
Also checked the FLASH0_ACCEN0 register and its value is 0xFFFFFFFF
Further information:
SCU_CCUCON0 at Power On Reset its Register Value is 0x01120148 and after a System Reset it is 0x12120112
The register values (fFSI2 and fSRI) aren't changed.
ENDINIT bit is cleared by Mcal_ResetENDINIT() -> Register value WDTCPU0CON0 is 0xFFFC000E before writing to FLASH0_FCON
Jul 08, 2021
03:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 08, 2021
03:54 AM
For anyone who encounters such a problem we are now able to write on the FLASH0_FCON register.
In the HtxStlIf.c file from hitex you can increase the value HTXSTLIF_FLASH_FCON_WSPFLASH from 2U to 4U and reset your RAM after a system reset.
Further information:
If you do not reset your RAM after a system reset is performed the Safety Endinit Semaphore will be set and you wouldn't be able to call the function Mcal_ResetSafetyENDINIT_Timed() succesfully as the spinlock is already aquired by another instance.
In the HtxStlIf.c file from hitex you can increase the value HTXSTLIF_FLASH_FCON_WSPFLASH from 2U to 4U and reset your RAM after a system reset.
Further information:
If you do not reset your RAM after a system reset is performed the Safety Endinit Semaphore will be set and you wouldn't be able to call the function Mcal_ResetSafetyENDINIT_Timed() succesfully as the spinlock is already aquired by another instance.