Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack writes to NVM while radio is transmitting #1586

Open
nfroggy opened this issue Nov 28, 2023 · 0 comments
Open

Stack writes to NVM while radio is transmitting #1586

nfroggy opened this issue Nov 28, 2023 · 0 comments

Comments

@nfroggy
Copy link

nfroggy commented Nov 28, 2023

Hi,

I noticed that if the call to NvmDataMgmtStore at src/apps/LoRaMac/common/LmHandler/LmHandler.c line 389 blocks while the radio is transmitting, the transmitter will stay on. This can cause problems with various radio transmission dwell-time limits (for example, the limit for the US915 region is 400 ms), and means that the radio transmission duty cycle is higher than expected.

Our internal fix for this is to check that the radio is not transmitting before trying to write to NVM:

if ( Radio.GetStatus( ) != RF_TX_RUNNING )
{    
    // Store to NVM if required
    size = NvmDataMgmtStore( );

    if( size > 0 )
    {
        if( LmHandlerCallbacks->OnNvmDataChange != NULL )
        {
            LmHandlerCallbacks->OnNvmDataChange( LORAMAC_HANDLER_NVM_STORE, size );
        }
    }
}

If you think this is an acceptable fix, I can do a pull request if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant