nanohub: driver/st_mag40: Fix hard fault in EVT_APP_START due to evtData == NULL

This commit fixes following hard fault when nanoapp starts (EVT_APP_START):

[ST_MAG40] set state 0
*HARD FAULT*
  R00  = 0x00000001  R08  = 0x0000002C
  R01  = 0x00000000  R09  = 0x00000000
  R02  = 0x20003A4C  R10  = 0x200025EC
  R03  = 0x20003790  R11  = 0x200028C0
  R04  = 0x00000400  R12  = 0xCCCCCCCD
  R05  = 0x00000000  R13  = 0x20000710
  R06  = 0x00000400  R14  = 0x08011F57
  R07  = 0x200028B4  R15  = 0x08011F56
  xPSR = 0x21000000  HFSR = 0x00000000
  CFSR = 0x00000082  BITS = 0x00000000
  TID  = 0x0102  TRIG = 0x0003 [MPU]

Basically when nanoapp starts the evtData pointer is NULL, causing the event
handler to crash. Solution is to avoid falling thru next case and call a
comm_tx operation instead. In addition to solving the crash, this method
cleanly reset all s/w registers to default values at startup.

Change-Id: I11259d3215bf07c1e9a4c4d792a7ddf57d6e3aaa
Signed-off-by: Armando Visconti <armando.visconti@st.com>
1 file changed
tree: e5b7a5988185b953088e28d32a02a0ed1ddcfa6b
  1. contexthubhal/
  2. firmware/
  3. inc/
  4. lib/
  5. sensorhal/
  6. util/
  7. .gitignore