Last Updated on : 2024-06-24 10:11:59download
This topic describes the production testing solution for modules and PCBAs based on Tuya’s Cloud Module Burning Authorization Platform.
Firmware flashing by Tuya
Tuya delivers the module that has been flashed with the license and firmware to you. The module is ready for use when you get it.
Firmware flashing by yourself
You flash the license and firmware to the module with the provided tools and documentation.
Integrate with Tuya production testing
Integrate your existing production system with Tuya’s host production testing SDK for authorization and testing.
Authorize modules with Tuya’s tool
Authorize the module after accidentally erasing the authorization information during debugging, or update the authorization. Flash the purchased license to the module using Tuya’s Cloud Module Burning Authorization Platform.
Flashing and authorization.
Read and write the MAC address, and write configuration information such as country code.
Test Wi-Fi and Bluetooth radio frequency.
Test module GPIOs.
For TuyaOS 3.4.0 and later, GPIO testing needs to be implemented by the application.
Test the peripherals of PCBA.
The peripherals vary for each PCBA board, so the framework does not handle the test commands for peripherals. Instead, it passes them to the application through callbacks for processing. You can contact your account manager or submit a service ticket to request the corresponding protocols.
The device operates continuously for 15 minutes after activation, and then the testing mode shuts down.
mf_test.h
TTL
to USB
converter.First, determine if the module is in testing mode. If not, the function will exit. If the module is in testing mode, a 500-millisecond window will begin for receiving the testing command.
OPRT_OK
.
typedef struct {
MF_UART_INIT_CB uart_init; // Initialize the test serial port.
MF_UART_FREE_CB uart_free; // Deinitialize the test serial port.
MF_UART_SEND_CB uart_send; // The test serial port sends data.
MF_UART_RECV_CB uart_recv; // The test serial port receives data.
MF_USER_PRODUCT_TEST_CB mf_user_product_test; // Commands for testing PCBA peripherals.
MF_USER_BASIC_TEST_CB mf_user_basic_test; // User testing commands, such as GPIO testing.
MF_USER_CALLBACK user_callback; // Notification after device authorization.
MF_USER_CALLBACK user_enter_mf_callback; // Notification when entering module testing.
} MF_IMPORT_INTF_S;
/**
* @brief mf test init function
*
* @param[in] intf mf test configure data
* @param[in] file_name App bin name
* @param[in] file_ver User Software version
* @param[in] wrMacEn Need write MAC or not
*
* @note some firmware need write MAC when mf test
*
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
*/
OPERATE_RET mf_init(IN CONST MF_IMPORT_INTF_S *intf, IN CHAR_T *file_name, IN CHAR_T *file_ver, IN BOOL_T wrMacEn);
This API is intended for debugging purposes only, to facilitate flashing and authorization. Do not use this API for production firmware.
Call this API before initializing module testing. The 500-millisecond window will be activated directly during module testing initialization, without checking if the module is in testing mode.
/**
* @brief ignore mf test closed flag
*
*/
VOID mf_test_ignore_close_flag(VOID);
After downloading the Networked Product Development Framework, you can find the example code for all features in the tuyaos_demo_examples
folder under the apps
directory. See the code in service_mf_test
. For the usage of the example code, see TuyaOS Example Collection.
The device operates continuously for 15 minutes after activation, and then the testing mode shuts down.
The serial port of the module is not properly connected to the host computer.
The baud rate on the host does not match the serial port, causing the module to fail to receive data.
The user serial port and the test serial port are the same. You initialize the user serial port before initializing module testing, causing the initialization of the test serial port to fail. It is recommended to initialize the user serial port after the module testing is initialized.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback