Class B safety library issues
1) Right after startup CPU check fails on following code:
MRS R0, APSR /* Get Status register */
CMP R0, #0xB8000000 /* Verifies that N=C=V=Q=1 */
BNE.W FailSafePOR /* Fails if Q+N+C=V clear */because APSR register have also GE bits set: 0xB80F0000. As a workaround I cleared all bits except QNCV that we are going to check:
MRS R1, APSR /* Get Status register */
AND R0, R1, #0xB8000000 /* Clear GE bits */
CMP R0, #0xB8000000 /* Verifies that N=C=V=Q=1 */
BNE.W FailSafePOR /* Fails if Q+N+C=V clear */This works, but if anyone can explain why this happens I would be happy.
2) Firmware CRC generated by the MS DOS/Windows .BAT files. Since I use MacOS it did not work for me and I had to rewrite it in perl (because I do use perl already for scripting in multi-platform development on MacOS and Linux). For those who are interested script attached, Anyway during debug session CubeIDE uses .elf binary with symbolic information and CRC check fail. For now I disabled it with:
#define DEBUG_CRC_CALCULATIONAs possible solution I think to flash firmware with CRC using CubeProgrammer and then connect to running program from CubeIDE without reprogramming and then debug as usual. If somebody knows how to do it in a simple way I would appreciate it.
Kirill
