UART Glitch On Startup Causes Hardfault in FreeRTOS

Change from -Og to -O2 optimization, no hardfault observed. Here is the code and listing:

Note changes:

  1. CMP BLS conditional is moved up in sequence,
  2. order within the if clause of MOVS MOV is reversed to MOV MOVS,
  3. the call to UpdSendShortCmd() goes from BL B to B.W NOP

Common to the no hardfault listings:

  • CMP BLS are the first two instructions

Cheers,
Joe