Skip to content

Commit 80ca704

Browse files
authored
Merge pull request #13 from Avnet/updatePublicFromPrivate
v1.6.1 changes
2 parents ac2fcb7 + 481a666 commit 80ca704

File tree

11 files changed

+118
-79
lines changed

11 files changed

+118
-79
lines changed

docs/ApplicationUserGuide.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ The NDP120 is configured by identifying the firmware images that will be loaded
8787

8888
- [Video Link (3 minutes)](http://avnet.me/RASynChangingMlModelsVideo)
8989

90-
There are two areas in the config.ini file to configure which NDP120 files are loaded to the NDP120 at startup.
90+
There are two areas in the config.ini file to configure which NDP120 files/model(s) are loaded to the NDP120 at startup.
9191

9292
1. ```[NDP Firmware]-->Mode=x```
9393

@@ -101,6 +101,11 @@ Each ```[Function_x]``` block defines a description, and the three required NDP1
101101
- ```MCU``` refers to the ARM-M0 firmware that runs on the NDP120. This firmware manages the devices and data flow.
102102
- ```DSP``` refers to the dsp firmware that runs on the NDP120. This firmware does data pre-processing plus other functions.
103103
- ```DNN``` refers to the Nerual Network Parameters and ML model. This firmware implements the ML model.
104+
- ```Event_Watch_Mode``` tells the NDP120 what data streams to watch and needs to align with the model defined in the ```DNN``` entry.
105+
- 1 == Audio
106+
- 2 == IMU
107+
- 3 == Combined Audio & IMU data
108+
104109

105110
![](./assets/images/ndpConfig.jpg "")
106111

@@ -131,9 +136,10 @@ There are two different ways to redefine the decimation_inshift vaules at startu
131136

132137
![](./assets/images/decimationInshift02.jpg "")
133138

134-
135139
## LED control
136-
The ```[LED]``` block allows the user to assign different RGB LED colors to each inference index. When the NDP120 detects a feature in the data the inference results are passed to the application. The application uses the index of the inference result [0 - n] to identify how to light the RGB LED on the I/O board. The comments in the config.ini file associate each index with the 5-keyword model, but this feature works with any model that's loaded.
140+
The ```[Led Network x]``` blocks allow the user to assign different RGB LED colors to each neural network and inference index. When the NDP120 detects a feature in the data the network number and inference results are passed to the application. The application uses the
141+
neural network number and the index of the inference result [0 - n] to identify how to light the RGB LED on the I/O board. The comments
142+
in the config.ini file associate each index with the 5-keyword model, but this feature works with any model that's loaded.
137143

138144
- [Video Link (3 minutes)](http://avnet.me/RASynChangeLedColorsVideo)
139145

docs/assets/images/ledConfig.jpg

66.5 KB
Loading

docs/assets/images/ndpConfig.jpg

41.8 KB
Loading
556 KB
Binary file not shown.

ndp120/synpkg_files/config.ini

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Description="5-keywords Single Mic"
1313
MCU=mcu_fw_120.synpkg
1414
DSP=dsp_firmware.synpkg
1515
DNN=menu_demo_512_general_v110_rasyn_pdm0_ext_icm.synpkg
16+
Event_Watch_Mode=1 # 1==Audio, 2==IMU, 3==Audio&IMU
1617
#DECIMATION_INSHIFT_VALUE=10 # http://avnet.me/RASynDocsDecimationInshift
1718

1819
# Reduce the 5-keyword model input audio gain by 6db for better performance
@@ -23,54 +24,89 @@ Description="5-keywords Dual Mic"
2324
MCU=mcu_fw_120.synpkg
2425
DSP=dsp_firmware_noaec_ff.synpkg
2526
DNN=menu_demo_512_noaec_ff_v110_rasyn_pdm0_ext_icm.synpkg
27+
Event_Watch_Mode=1 # 1==Audio, 2==IMU, 3==Audio&IMU
2628

2729
[Function_3]
2830
Description="Circle Motion"
2931
MCU=mcu_fw_120.synpkg
3032
DSP=dsp_firmware.synpkg
3133
DNN=circular_motion_NDP120B0_icm42670_pcm_ext.synpkg
3234
Button_shift=imu # redefine the short press user button to capture the IMU data
35+
Event_Watch_Mode=2 # 1==Audio, 2==IMU, 3==Audio&IMU
3336

3437
[Function_4]
3538
Description="Edge Impulse Audio Model Configuration"
3639
MCU=mcu_fw_120.synpkg
3740
DSP=dsp_firmware.synpkg
3841
DNN=ei_model.synpkg
42+
Event_Watch_Mode=1 # 1==Audio, 2==IMU, 3==Audio&IMU
3943

4044
[Function_5]
4145
Description="Edge Impulse Motion Model Configuration"
4246
MCU=mcu_fw_120.synpkg
4347
DSP=dsp_firmware.synpkg
4448
DNN=ei_motion_model.synpkg
4549
Button_shift=imu
50+
Event_Watch_Mode=2 # 1==Audio, 2==IMU, 3==Audio&IMU
4651

4752
[Function_6]
4853
Description="Alexa Single Mic"
4954
MCU=mcu_fw_120.synpkg
5055
DSP=dsp_firmware.synpkg
5156
DNN=alexa_334_NDP120_B0_v11.synpkg
57+
Event_Watch_Mode=1 # 1==Audio, 2==IMU, 3==Audio&IMU
5258

5359
[Function_7]
5460
Description="Alexa Dual Mic"
5561
MCU=mcu_fw_120.synpkg
5662
DSP=dsp_firmware_noaec_ff.synpkg
5763
DNN=alexa_334ua__v2_ndp120b0_noaec_ff.synpkg
64+
Event_Watch_Mode=1 # 1==Audio, 2==IMU, 3==Audio&IMU
5865

5966
[Function_8]
6067
Description="5-keywords Single Mic and Circular Motion Fusion"
6168
MCU=mcu_fw_120.synpkg
6269
DSP=dsp_firmware.synpkg
6370
DNN=combined_imu_kws_ndp120_v3.synpkg
71+
Event_Watch_Mode=3 # 1==Audio, 2==IMU, 3==Audio&IMU
72+
# Reduce the 5-keyword model input audio gain by 6db for better performance
73+
DECIMATION_INSHIFT_OFFSET=-1
74+
75+
[Function_9]
76+
Description="Alexa Single Mic and Circular Motion Fusion"
77+
MCU=mcu_fw_120.synpkg
78+
DSP=dsp_firmware.synpkg
79+
DNN=alexa334_circular_v2-2024-06-24.synpkg
80+
Event_Watch_Mode=3 # 1==Audio, 2==IMU, 3==Audio&IMU
81+
82+
[Function_10]
83+
Description="RASynPuck Demo"
84+
MCU=mcu_fw_120.synpkg
85+
DSP=dsp_firmware.synpkg
86+
DNN=RASynPuckDemoV1.synpkg
87+
Button_shift=imu # redefine the short press user button to capture the IMU data
88+
Event_Watch_Mode=2 # 1==Audio, 2==IMU, 3==Audio&IMU
6489

6590
# http://avnet.me/RASynDocsLeds
66-
[Led]
91+
# Define which color LED the application will light for network 0 inference events
92+
[Led Network 0]
6793
# set led response color for each voice command, choose from # "red","green","blue","yellow","cyan" and "magenta".
68-
IDX0=yellow # ok-syntiant
94+
IDX0=blue # ok-syntiant
6995
IDX1=cyan # up
7096
IDX2=magenta # down
7197
IDX3=red # back
7298
IDX4=green # next
7399

100+
# http://avnet.me/RASynDocsLeds
101+
# Define which color LED the application will light for network 1 inference events
102+
[Led Network 1]
103+
# set led response color for each voice command, choose from # "red","green","blue","yellow","cyan" and "magenta".
104+
IDX0=green
105+
IDX1=red
106+
IDX2=blue
107+
IDX3=cyan
108+
IDX4=yellow
109+
74110
# http://avnet.me/RASynDocsDebugPort
75111
[Debug Print]
76112
# Select debug port for application debug:
File renamed without changes.

releaseNotes.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## Version: 1.6.1
2+
Release type: **Feature Release**
3+
4+
Date: June 25, 2024
5+
6+
## Note: The V1.6.1 release is compatible with Edge Impulse Models generated after June 10th 2024
7+
8+
### New Features
9+
- AAGBT-166: Add config.ini support to identify how the NDP120 pulls in data for each model (audio, IMU, or audio & IMU)
10+
- AAGBT-168: Add config.ini support to identify which LED color lights by neural network number and inference index
11+
12+
### Bug Fixes
13+
None
14+
15+
### Known Issues
16+
- AAGBT-165: When capturing IMU data converted from ADC values to accelerometer and gyro units to debug sometimes the application hangs. This appears to be a floating point printf() issue and is currently masked by reducing the floating point precision to 3 places. For full precision data, please capture converted IMU data to the microSD card file system.
17+
- AAGBT-159: The EVK does not power up with powered by just a battery. See [troubleshooting guide](https://github.com/Avnet/RASynBoard-Out-of-Box-Demo/blob/rasynboard_v2_tiny/docs/RASynTroubleshootingGuide.md#the-rasynboard-evk-io-board--core-board-does-not-power-up-when-using-just-a-lipo-battery) for a work around
18+
- AAGBT-159: When powering EVK from a battery the RGB LEDs are not powered. See [troubleshooting guide](https://github.com/Avnet/RASynBoard-Out-of-Box-Demo/blob/rasynboard_v2_tiny/docs/RASynTroubleshootingGuide.md#the-rasynboard-evk-io-board--core-board-does-not-power-up-when-using-just-a-lipo-battery) for a hardware work around
19+
- AAGBT-105: When using a custom BLE name, the OOB application is not able to connect to the Python GUI demo application
20+
- AAGBT-123: When capturing audio, or IMU data if there is an issue receiving data from the NDP120 the application hangs
21+
122
## Version: 1.6.0
223
Release type: **Feature Release**
324

src/fat_load.c

Lines changed: 38 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct config_ini_items config_items ={ /* default settings */
3333
LED_EVENT_NONE },
3434

3535
.recording_period = 10,
36+
.event_watch_mode = 1,
3637
.imu_conversion_enabled = 1,
3738
.imu_write_to_file = IMU_FUNC_ENABLE,
3839
.imu_print_to_terminal = IMU_FUNC_DISABLE,
@@ -67,7 +68,6 @@ static uint32_t fatfs_total_sectors;
6768
static int boot_mode = BOOT_MODE_NONE;
6869
static int sdcard_slot_status = SDCARD_IN_SLOT;
6970
static int print_console_type = CONSOLE_UART;
70-
static uint32_t event_watch_mode = WATCH_TYPE_AUDIO; //default
7171

7272
char mode_description[64] = {0};
7373
int mode;
@@ -504,37 +504,14 @@ void write_extraction_file_end(void)
504504
}
505505
}
506506

507-
static void parse_event_watch_mode( void )
508-
{
509-
switch (mode)
510-
{
511-
case 3:
512-
case 5:
513-
event_watch_mode = WATCH_TYPE_MOTION;
514-
break;
515-
516-
case 8:
517-
event_watch_mode = WATCH_TYPE_AUDIO | WATCH_TYPE_MOTION;
518-
break;
519-
520-
case 1:
521-
case 2:
522-
case 4:
523-
case 6:
524-
case 7:
525-
default:
526-
event_watch_mode = WATCH_TYPE_AUDIO;
527-
break;
528-
}
529-
}
530-
531507
static uint32_t read_config_file( void )
532508
{
533509
FRESULT res;
534510
FILINFO fno;
535511
char inifile[] = "0:/config.ini";
536512
char color[16] = {0};
537513
char key[6] = {0};
514+
char net[16] = {0};
538515
char section[24] = {0};
539516

540517
// mount
@@ -557,7 +534,6 @@ static uint32_t read_config_file( void )
557534
/* Read config.ini from sdcard */
558535
mode = ini_getl("NDP Firmware", "Mode", 0, inifile);
559536
sprintf(section, "Function_%d", mode);
560-
parse_event_watch_mode();
561537

562538
ini_gets(section, "Description", NULL, config_items.mode_description, sizeof(config_items.mode_description), inifile);
563539

@@ -571,37 +547,40 @@ static uint32_t read_config_file( void )
571547
config_items.button_switch, sizeof(config_items.button_switch), inifile);
572548
config_items.dec_inshift_value = ini_getl(section, "DECIMATION_INSHIFT_VALUE", DEC_INSHIFT_VALUE_DEFAULT, inifile);
573549
config_items.dec_inshift_offset = ini_getl(section, "DECIMATION_INSHIFT_OFFSET", DEC_INSHIFT_OFFSET_DEFAULT, inifile);
574-
575-
/* Get led color according according to voice command */
576-
for (int idx = 0; idx < LED_EVENT_NUM; idx++)
577-
{
578-
sprintf(key, "IDX%d", idx);
579-
ini_gets("Led", key, "-", color, sizeof(color), inifile);
580-
581-
if( strncmp(color, "red", 3) == 0)
582-
{
583-
config_items.led_event_color[idx] = LED_COLOR_RED;
584-
} else if( strncmp(color, "green", 5) == 0)
585-
{
586-
config_items.led_event_color[idx] = LED_COLOR_GREEN;
587-
} else if( strncmp(color, "blue", 4) == 0)
588-
{
589-
config_items.led_event_color[idx] = LED_COLOR_BLUE;
590-
} else if( strncmp(color, "cyan", 4) == 0)
591-
{
592-
config_items.led_event_color[idx] = LED_COLOR_CYAN;
593-
} else if( strncmp(color, "magenta", 6) == 0)
594-
{
595-
config_items.led_event_color[idx] = LED_COLOR_MAGENTA;
596-
} else if( strncmp(color, "yellow", 6) == 0)
597-
{
598-
config_items.led_event_color[idx] = LED_COLOR_YELLOW;
599-
} else
600-
{
601-
config_items.led_event_color[idx] = LED_EVENT_NONE;
602-
}
550+
config_items.event_watch_mode = ini_getl(section, "Event_Watch_Mode", WATCH_TYPE_AUDIO, inifile);
551+
552+
/* Get led color according to network number and inference index */
553+
for (int network = 0; network < LED_NETWORK_NUM; network++){
554+
for (int idx = 0; idx < LED_EVENT_NUM; idx++)
555+
{
556+
sprintf(net, "LED Network %d", network);
557+
sprintf(key, "IDX%d", idx);
558+
ini_gets(net, key, "-", color, sizeof(color), inifile);
559+
560+
if( strncmp(color, "red", 3) == 0)
561+
{
562+
config_items.led_event_color_data[network][idx] = LED_COLOR_RED;
563+
} else if( strncmp(color, "green", 5) == 0)
564+
{
565+
config_items.led_event_color_data[network][idx] = LED_COLOR_GREEN;
566+
} else if( strncmp(color, "blue", 4) == 0)
567+
{
568+
config_items.led_event_color_data[network][idx] = LED_COLOR_BLUE;
569+
} else if( strncmp(color, "cyan", 4) == 0)
570+
{
571+
config_items.led_event_color_data[network][idx] = LED_COLOR_CYAN;
572+
} else if( strncmp(color, "magenta", 6) == 0)
573+
{
574+
config_items.led_event_color_data[network][idx] = LED_COLOR_MAGENTA;
575+
} else if( strncmp(color, "yellow", 6) == 0)
576+
{
577+
config_items.led_event_color_data[network][idx] = LED_COLOR_YELLOW;
578+
} else
579+
{
580+
config_items.led_event_color_data[network][idx] = LED_EVENT_NONE;
581+
}
582+
}
603583
}
604-
605584
print_console_type = ini_getl("Debug Print", "Port", CONSOLE_UART, inifile);
606585
config_items.recording_period = ini_getl("Recording Period", "Recording_Period", 10, inifile);
607586
config_items.low_power_mode = ini_getl("Low Power Mode", "Power_Mode",DOWN_DOWN_LP_MODE, inifile);
@@ -755,12 +734,7 @@ int get_print_console_type( void )
755734

756735
uint32_t get_event_watch_mode()
757736
{
758-
return event_watch_mode;
759-
}
760-
761-
void set_event_watch_mode(uint32_t watch_mode)
762-
{
763-
event_watch_mode = watch_mode;
737+
return config_items.event_watch_mode;
764738
}
765739

766740
// Returns number of seconds to record data (audio or IMU data)
@@ -832,8 +806,8 @@ void printConfg(void)
832806

833807
printf("\n Operation mode=%d selected: %s\r\n", mode, config_items.mode_description);
834808
printf(" Event Watching Mode: %s %s\r\n",
835-
(event_watch_mode&WATCH_TYPE_AUDIO)?"Key-Word":"",
836-
(event_watch_mode&WATCH_TYPE_MOTION)?"IMU-Motion":"");
809+
(get_event_watch_mode()&WATCH_TYPE_AUDIO)?"Key-Word":"",
810+
(get_event_watch_mode()&WATCH_TYPE_MOTION)?"IMU-Motion":"");
837811

838812
// Output recording feature driven by Low Power Mode Selection
839813
if(config_items.low_power_mode == DOWN_DOWN_LP_MODE){

src/fat_load.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#undef FLOATING_POINT_PRINTF_BUG
3737

3838
#define LED_EVENT_NUM 10
39+
#define LED_NETWORK_NUM 2
3940

4041
enum FW_LOAD_TYPE {
4142
BOOT_MODE_FLASH = 0,
@@ -116,7 +117,9 @@ enum WIF_CONFIG_TYPE {
116117
struct config_ini_items {
117118
/* save the settings from config.ini */
118119
char button_switch[8]; /** [Function_x]-->Button_shift **/
119-
int led_event_color[LED_EVENT_NUM]; /** [Led]-->IDXn **/
120+
int event_watch_mode; /** [Function_x]-->event_watch_mode **/
121+
int led_event_color[LED_EVENT_NUM];
122+
int led_event_color_data[LED_NETWORK_NUM][ LED_EVENT_NUM]; /** [Led Network x]-->IDXn **/
120123

121124
int recording_period; /** [Recording Period]-->Recording_Period **/
122125
int imu_write_to_file; /** [IMU data stream]-->Write_to_file **/

0 commit comments

Comments
 (0)