Problem with 1st time program command
I'm noticing a situation where after a reset, my program statement fails. If after the failure I press the start again, the program statement will succeed. My script is below.
NOTE:
The 1st program statement has two references to %MFG_TEST% as the statement
"-command: program nrf52 %MFG_TEST%,NULL,NULL" fails
Also, the retry parameter does not seem to apply to program
#
# Card Access Wildcat Manyfacturing Tests
#
title: "Wildcat Manufacturing Tests"
suite:
- ident: INIT-00
title: Display CAE Logo
steps:
- command: image set CAE_LOGO.png
- ident: INIT-01
title: Setup parameters
steps:
- command: uartCfg UART0 115200 8N1
- command: uartCfg UART1 115200 8N1
- command: define SOFTDEVICE_NAME "s132_nrf52_3.0.0_softdevice.hex"
- command: define BOOTLOADER_NAME "BootloaderSigned-1.2-nrf52832.hex"
- command: define FIRMWARE_NAME "Wildcat-0.16-nrf52832-MFG.hex"
- command: define MFG_TEST_NAME "zephyr.hex"
- command: sleepms 2000
#
# Scan Module
#
# - ident: SCAN-01
# title: Scan Module
# steps:
# - command: operator "Scan Module"
# - command: scan ANY
# extractKey: MODULEID
# - ident: SCAN-02
# title: Module Insert
# steps:
# - command: operator "Insert Module"
#
# Power on Unit
#
- ident: INIT-02
title: Power on
steps:
- command: power SWD on
- command: power UART0 on
- command: power UART1 on
- command: sleepms 1000
#
# Load and Run Manufacturing Test Code
#
- ident: LOAD-01
title: Load and Run Manufacturing Test Code
steps:
- command: identify nRF52
- command: erase nRF52
- command: program nRF52 %MFG_TEST_NAME%,%MFG_TEST_NAME%,NULL
retry: 3
- command: sleepms 2000
#
#
# Obtain Serial Number, MacAddr and Keys from Key Storage Server
#
- ident: VAR0
title: Setup Firmware Version
steps:
- uartcmd: uart UART1
send: "firmware TEST-0.01-0000r\n"
- ident: VAR1
title: Get Serial Number
steps:
- uartcmd: uart UART1
send: "send_serial\n"
extract: "([A-Fa-f0-9]{10})"
extractKey: SERIALNO
mstimeout: 2000
- ident: VAR2
title: Get Mac Address
steps:
- uartcmd: uart UART1
send: "send_mac\n"
extract: "([A-Fa-f0-9:]{17})"
extractKey: MACADDR
mstimeout: 2000
- ident: VAR3
title: Get Secret Key
steps:
- uartcmd: uart UART1
send: "send_key\n"
extract: "([A-Fa-f0-9]{64})"
extractKey: KEYNO
mstimeout: 2000
- ident: VAR4
title: Get Broadcast Name
steps:
- uartcmd: uart UART1
send: "send_broadcast\n"
extract: "([A-Fa-f0-9]{8})"
extractKey: BCASTNAME
mstimeout: 2000
#
#
# Initiate Manufacturing Firmware Tests
#
#
- ident: MTC-00
title: Write UICR
steps:
- uartcmd: uart UART0
send: "6"
- uartcmd: uart UART0
send: "%SERIALNO%,%MACADDR%,%KEYNO%\n"
mstimeout: 2000
- ident: MTC-01
title: PowerIn Test
steps:
- uartcmd: uart UART0
send: "1"
expect: "SUCCESS"
mstimeout: 3000
- ident: MTC-02
title: Power Supple Test
steps:
- uartcmd: uart UART0
send: "2"
expect: "SUCCESS"
mstimeout: 3000
- ident: MTC-08
title: Scan Test
steps:
- uartcmd: uart UART0
send: "s"
- sleepms: 5000
- uartcmd: uart UART0
send: "s"
- ident: MTC-09
title: BLE Advertise-Discovery Test
steps:
- uartcmd: uart UART0
send: "a"
- command: bledis %BLEMAC% 30
- uartcmd: uart UART0
send: "a"
#
# Write Production Firmware
#
- ident: PROD-01
title: Write Production Firmware
steps:
- command: identify nRF52
- command: program nRF52 %SOFTDEVICE_NAME%,%FIRMWARE_NAME%,%BOOTLOADER_NAME% noerase
- command: sleepms 2000
- ident: PROD-02
title: Run Final Production Tests
steps:
# - uartcmd: uart UART1
# send: "send_broadcast\n"
# extract: "([A-Fa-f0-9]{8})"
# extractKey: BCASTNAME
# mstimeout: 2000
- command: sleepms 1000
- command: ble gatt connect name:%BCASTNAME% 30
- command: ble gatt discover
- command: ble gatt disconnect
- ident: REG-01
title: Registration of Module
steps:
- uartcmd: uart UART1
send: "next\n"
- ident: PRINT-00
title: Print Label
steps:
- command: label keys SERIALNO
- ident: FINAL-00
title: Power off
steps:
- command: power off
-
Upon further evaluation, it seems the program statement has an issue with the three variables for programming the nrf52. The following seem to be required.
1) The statement program requires three files, application, soft device, and bootloader. However, the documentation states that only one file is required and the others are optional. If I use NULL for the file #2 and three the statement fails. Typically when we are using Zephyr as the application, a Soft Device file is not needed.
2) I have my program statement coded up as the following:
command: program nrf52 %MFG_TEST_NAME%,%MFG_TEST_NAME%, NULL
Occasionally this works just fine, however, most of the time the first execution of this program statement fails and a restart is need, and usually passes after the first execution.
Please sign in to leave a comment.
Comments
1 comment