Add additional debug output

This adds some more details about RX and TX bytes and TX config. There
is also some code for RX config, but to minimize the impact on RX
timing, that is commented out.
This commit is contained in:
Matthijs Kooijman 2022-09-13 12:12:16 +02:00
parent 1c17e31589
commit 17482cea0d
2 changed files with 31 additions and 0 deletions
Middlewares/Third_Party
LoRaWAN/Mac
SubGHz_Phy/stm32_radio_driver

View File

@ -1127,6 +1127,11 @@ static void ProcessRadioRxDone( void )
#endif /* LORAMAC_VERSION */
Mlme_t joinType = MLME_JOIN;
MW_LOG( TS_ON, VLEVEL_M, "RX: ");
for (size_t i = 0; i < RxDoneParams.Size; ++i)
MW_LOG( TS_ON, VLEVEL_M, "%02x", RxDoneParams.Payload[i]);
MW_LOG( TS_ON, VLEVEL_M, "\r\n");
#if (defined( LORAMAC_VERSION ) && (( LORAMAC_VERSION == 0x01000400 ) || ( LORAMAC_VERSION == 0x01010100 )))
LoRaMacRadioEvents.Events.RxProcessPending = 0;
#endif /* LORAMAC_VERSION */

View File

@ -868,6 +868,18 @@ static void RadioSetRxConfig( RadioModems_t modem, uint32_t bandwidth,
#if (RADIO_SIGFOX_ENABLE == 1)
uint8_t modReg;
#endif
//Disabled, too much influence on RX timing
/*
MW_LOG( TS_ON, VLEVEL_M,
"Setting RX Config: modem=%s, bandwidth=%u, datarate=%u, coderate=%u bandwithAfc=%u, preambleLen=%u, symbTimeout=%u, fixLen=%u, payloadLen=%u, crcOn=%u, freqHopOn=%u, hopPeriod=%u, iqInverted=%u, rxContinuous=%u\r\n",
modem == MODEM_FSK ? "MODEM_FSK" : (modem == MODEM_LORA ? "MODEM_LORA" : "?"),
(unsigned)bandwidth, (unsigned)datarate, (unsigned)coderate,
(unsigned)bandwidthAfc, (unsigned)preambleLen,
(unsigned)symbTimeout, (unsigned)fixLen, (unsigned)payloadLen,
(unsigned)crcOn, (unsigned)freqHopOn, (unsigned)hopPeriod,
(unsigned)iqInverted, (unsigned)rxContinuous
);
*/
SubgRf.RxContinuous = rxContinuous;
RFW_DeInit();
if( rxContinuous == true )
@ -1057,6 +1069,15 @@ static void RadioSetTxConfig( RadioModems_t modem, int8_t power, uint32_t fdev,
SubgRf.lr_fhss.is_lr_fhss_on = false;
#endif /* RADIO_LR_FHSS_IS_ON == 1 */
RFW_DeInit();
MW_LOG( TS_ON, VLEVEL_M,
"Setting TX Config: modem=%s, power=%u, fdev=%u, bandwidth=%u, datarate=%u, coderate=%u preambleLen=%u, fixLen=%u, crcOn=%u, freqHopOn=%u, hopPeriod=%u, iqInverted=%u, timeout=%u\r\n",
modem == MODEM_FSK ? "MODEM_FSK" : (modem == MODEM_LORA ? "MODEM_LORA" : "?"),
(int)power, (unsigned)fdev, (unsigned)bandwidth,
(unsigned)datarate, (unsigned)coderate, (unsigned)preambleLen,
(unsigned)fixLen, (unsigned)crcOn, (unsigned)freqHopOn,
(unsigned)hopPeriod, (unsigned)iqInverted, (unsigned)timeout
);
switch( modem )
{
case MODEM_FSK:
@ -1315,6 +1336,11 @@ static radio_status_t RadioSend( uint8_t *buffer, uint8_t size )
IRQ_RADIO_NONE,
IRQ_RADIO_NONE );
MW_LOG( TS_ON, VLEVEL_M, "TX:");
for (size_t i = 0; i < size; ++i)
MW_LOG( TS_ON, VLEVEL_M, " %02x", buffer[i]);
MW_LOG( TS_ON, VLEVEL_M, "\r\n");
/* Set DBG pin */
DBG_GPIO_RADIO_TX( SET );