@@ -283,17 +283,19 @@ static bool has_otp_info = false;
283283
284284bool getSecureFlashData () {
285285static OptaBoardInfo info;
286- char temp_buf[sizeof (OptaBoardInfo) +1 ];
287- int ret = QSPI_STATUS_OK;
288- mbed::QSPI_qspi (QSPI_FLASH1_IO0, QSPI_FLASH1_IO1, QSPI_FLASH1_IO2, QSPI_FLASH1_IO3, QSPI_FLASH1_SCK, QSPI_FLASH1_CSN, QSPIF_POLARITY_MODE_0);
289- auto rxlen =sizeof (temp_buf);
290- ret = _qspi.read (0x48 , -1 ,1 <<13 , temp_buf, &rxlen);
286+ uint8_t temp_buf[sizeof (OptaBoardInfo) +1 ];
287+ int ret =0 ;
288+ static SecureQSPIFBlockDevice secure_root;
289+ secure_root.init ();
290+ // read secure sector 2 ( address 1 << 13 )
291+ ret = secure_root.readSecure (temp_buf, (1 <<13 ),sizeof (temp_buf));
291292memcpy (&info, &temp_buf[1 ],sizeof (OptaBoardInfo));
292293if (info.magic == OTP_QSPI_MAGIC) {
293294 _boardInfo = (uint8_t *)&info;
294295 has_otp_info =true ;
295296 }
296- return ret == QSPI_STATUS_OK;
297+ secure_root.deinit ();
298+ return ret ==0 ;
297299}
298300
299301uint8_t *boardInfo () {