cancel
Showing results for 
Search instead for 
Did you mean: 

Using SIM Card with Pin Code in STM32CubeExpansion_Cloud_AZURE_V1.2.1

Slh
Senior

I am using board P-L496G-CELL0x and STM32CubeExpansion_Cloud_AZURE_V1.2.1 software. When I use a SIM card without a Pin Code, the program works fine and I can connect to Microsoft Azure. But the problem is that when the SIM card has a Pin Code, the program does not run and does not ask me for a Pin Code in the terminal.

What should I do to use the SIM card with Pin code?

There is a function in the program called:

at_status_t called fCmdBuild_CPIN (atparser_context_t * p_atp_ctxt, atcustom_modem_context_t * p_modem_ctxt) 

That is related to the PIN code, but I do not know how to use it and what other functions may should use.

1 ACCEPTED SOLUTION

Accepted Solutions
Guillaume K
ST Employee

I've found one place where the PIN code seems to be set : it's in Middlewares\ST\STM32_Cellular\Core\Cellular_Service\Radio_Service\Cellular\Src\cellular_service_task.c where function CST_init_modem_mngt() calls osCDS_init_modem() with parameter GOOD_PIN_CODE. GOOD_PIN_CODE is defined as empty string "" at beginning of same file. You can try to change GOOD_PIN_CODE with your SIM card PIN code in this source file. Apparently there's no way to set it from upper levels (application).

View solution in original post

2 REPLIES 2
Guillaume K
ST Employee

I've found one place where the PIN code seems to be set : it's in Middlewares\ST\STM32_Cellular\Core\Cellular_Service\Radio_Service\Cellular\Src\cellular_service_task.c where function CST_init_modem_mngt() calls osCDS_init_modem() with parameter GOOD_PIN_CODE. GOOD_PIN_CODE is defined as empty string "" at beginning of same file. You can try to change GOOD_PIN_CODE with your SIM card PIN code in this source file. Apparently there's no way to set it from upper levels (application).

Slh
Senior

Thank you. It works👍