Skip to content

Commit c989486

Browse files
MLECO-4703: Updates for pack versions
Alif Semiconductor's Ensemble support updated for the AI/ML AppKit boards. Support for the older revisions of the boards has been dropped as the CMSIS pack versions available don't support these older variants. Most changes are to adapt to the newer pack version. Further changes are required to get the ILI9806E LCD to work correctly. Change-Id: If0a912f3a00685cd7314881c45611cac0ceaf109 Signed-off-by: Kshitij Sisodia <[email protected]>
1 parent 739fdf1 commit c989486

27 files changed

+385
-323
lines changed

cmsis-pack-examples/README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ Currently, the following examples are supported:
3434

3535
Target platforms supported:
3636

37-
| Name | Type | IP | Examples |
38-
|---------------------|---------------------|-----------------------------------------------|----------|
39-
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
40-
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
41-
| Alif Ensemble E7 | Physical board | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 NPU | All |
42-
| STM32F746G-Discovery| Physical board | Arm® Cortex®-M7 CPU | KWS |
43-
| NXP FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
37+
| Name | Type | IP | Examples |
38+
|-----------------------|---------------------|-----------------------------------------------|----------|
39+
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
40+
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 or Arm® Ethos™-U65 NPU | All |
41+
| Alif Ensemble E7 AI/ML Kit | Physical board | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 NPU | All |
42+
| STM32® F746G-Discovery| Physical board | Arm® Cortex®-M7 CPU | KWS |
43+
| NXP® FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
4444

4545

4646
Use this import button to open the solution in Keil Studio Cloud: [![Open in Keil Studio](https://img.shields.io/badge/Keil%20Studio-Import-blue?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS40LjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA0NyAxNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDcgMTQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJLnN0MHtmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00LjcsN2MwLDIuMiwxLjQsNC4xLDMuNSw0LjFjMS44LDAsMy42LTEuNCwzLjYtNC4xYzAtMi44LTEuNy00LjItMy42LTQuMkM2LjIsMi45LDQuNyw0LjcsNC43LDcgTTExLjYsMC41DQoJaDIuOXYxM2gtMi45di0xLjNjLTAuOSwxLjEtMi4zLDEuNy0zLjcsMS43QzQsMTMuOSwxLjgsMTAuNiwxLjgsN2MwLTQuMywyLjctNi45LDYuMS02LjljMS41LDAsMi44LDAuNywzLjcsMS45VjAuNXoiLz4NCjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0xOCwwLjVIMjF2MS4yYzAuMy0wLjQsMC43LTAuOCwxLjItMS4xYzAuNS0wLjMsMS4yLTAuNCwxLjctMC40YzAuOCwwLDEuNiwwLjIsMi4zLDAuNmwtMS4yLDIuOA0KCWMtMC40LTAuMy0xLTAuNC0xLjUtMC40Yy0wLjctMC4xLTEuMywwLjItMS44LDAuN0MyMSw0LjYsMjEsNS45LDIxLDYuOHY2LjdIMThWMC41eiIvPg0KPHBhdGggY2xhc3M9InN0MCIgZD0iTTI4LjIsMC41aDIuOXYxLjJjMC43LTAuOSwxLjktMS42LDMuMS0xLjZjMS4zLDAsMi42LDAuNywzLjIsMS45YzAuOS0xLjIsMi4yLTEuOSwzLjctMS45DQoJQzQyLjcsMCw0NCwwLjksNDQuNywyLjJjMC4yLDAuNCwwLjcsMS40LDAuNywzLjN2OC4xaC0yLjlWNi4zYzAtMS41LTAuMi0yLjEtMC4yLTIuM2MtMC4yLTAuNy0wLjktMS4yLTEuNy0xLjENCgljLTAuNywwLTEuMywwLjMtMS43LDAuOWMtMC41LDAuOC0wLjYsMS45LTAuNiwyLjl2Ni43aC0yLjlWNi4zYzAtMS41LTAuMi0yLjEtMC4yLTIuM2MtMC4yLTAuNy0wLjktMS4yLTEuNy0xLjENCgljLTAuNywwLTEuMywwLjMtMS43LDAuOWMtMC41LDAuOC0wLjYsMS45LTAuNiwyLjl2Ni43aC0yLjlMMjguMiwwLjV6Ii8+DQo8L3N2Zz4NCg==&logoWidth=47)](https://studio.keil.arm.com/?import=https://github.com/Arm-Examples/mlek-cmsis-pack-examples.git)
@@ -224,17 +224,18 @@ Note that most applications will redirect their standard output and error stream
224224
Keil Sudio Cloud has an option to open a serial connection that can be used to monitor these
225225
streams.
226226

227-
For the Alif Semiconductor's Ensemble DevKit boards, the output over UART is not wired though any
228-
USB. A 1.8V FTDI USART cable is recommended to view the serial output. By default, the high
229-
performance core uses UART device 4, and the high efficiency core uses UART device 2. Check the
230-
board schematic to see which pins these modules use. For the Rev1 version of the board the pins
231-
are:
227+
For the Alif Semiconductor™ Ensemble™ AI/ML kit boards, the output over UART is wired though port
228+
J2 (maked PRG_USB). This port exposes two UARTs - one for SE (Secure Enclave) and the other is
229+
confirable to pass through either UART2 or UART4 using jumpers on J15. For the applications built,
230+
the high performance core uses UART4, and the high efficiency core uses UART2.
231+
232+
J15 setup is shown below:
232233

233234
```
234-
UART2 RX_B on J413 pin 13 (P3_16) ↔ FTDI TX
235-
UART2 TX_B on J413 pin 14 (P3_17) ↔ FTDI RX
236-
UART4 RX_B on J412 pin 11 (P3_1) ↔ FTDI TX
237-
UART4 TX_B on J412 pin 12 (P3_2) ↔ FTDI RX
235+
J15-1-3 & 2-4: SE UART
236+
J15-3-5 & 4-6: UART2
237+
J15-5-7 & 6-8: UART2
238+
J15-7-9 & 8-10: UART4
238239
```
239240
For all other targets, serial is available over USB from primary debug/connection port.
240241

cmsis-pack-examples/cdefault.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its
1+
# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its
22
# affiliates <[email protected]>
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.0.0/tools/projmgr/schemas/cdefault.schema.json
17+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.4.0/tools/projmgr/schemas/cdefault.schema.json
1818

1919
default:
2020
# Note that we need [email protected] or higher to compile for Corstone-310 target.

cmsis-pack-examples/common/common.clayer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its
1+
# SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its
22
# affiliates <[email protected]>
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.0.0/tools/projmgr/schemas/clayer.schema.json
17+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.4.0/tools/projmgr/schemas/clayer.schema.json
1818

1919
layer:
2020

cmsis-pack-examples/device/alif-ensemble/alif-ensemble-E7-device.clayer.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its
1+
# SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its
22
# affiliates <[email protected]>
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.0.0/tools/projmgr/schemas/clayer.schema.json
17+
# yaml-language-server: $schema=https://raw.githubusercontent.com/Open-CMSIS-Pack/devtools/schemas/projmgr/2.4.0/tools/projmgr/schemas/clayer.schema.json
1818

1919
layer:
2020
description: Alif Ensemble E7 ML islands' CPU device layer (High-Performance and High-Efficiency Arm Cortex-M55 CPUs).
@@ -26,7 +26,8 @@ layer:
2626
files:
2727
- file: ./src/GpioSignal.cpp
2828
- file: ./include/GpioSignal.hpp
29-
- file: ./src/gpio.c
29+
- file: ./src/gpio_wrapper.c
30+
- file: ./src/gpio_wrapper.h
3031

3132
- group: AudioHelpers
3233
for-context: +Alif-E7-M55-HE
@@ -64,11 +65,10 @@ layer:
6465
- component: AlifSemiconductor::Device:SOC Peripherals:USART
6566
- component: AlifSemiconductor::Device:SOC Peripherals:GPIO
6667
- component: AlifSemiconductor::Device:SOC Peripherals:PINCONF
68+
- component: AlifSemiconductor::Device:SOC Peripherals:MHU
6769
- component: AlifSemiconductor::Device:Startup
6870
- component: ARM::CMSIS Driver:USART
6971
- component: ARM::CMSIS Driver:USART:Custom
70-
- component: AlifSemiconductor::Device:SE Services:SE RunTime services&Source
71-
- component: AlifSemiconductor::Device:SE Services:MHU Driver
7272

7373
- component: AlifSemiconductor::Device:SOC Peripherals:DMA
7474
for-context: +Alif-E7-M55-HE
@@ -79,7 +79,7 @@ layer:
7979
- component: AlifSemiconductor::Device:SOC Peripherals:I3C
8080
for-context: +Alif-E7-M55-HP
8181

82-
- component: AlifSemiconductor::Device:SOC Peripherals:CDC200
82+
- component: AlifSemiconductor::Device:SOC Peripherals:CDC
8383
for-context: +Alif-E7-M55-HP
8484

8585
- component: AlifSemiconductor::Device:SOC Peripherals:MIPI CSI2
@@ -88,11 +88,22 @@ layer:
8888
- component: AlifSemiconductor::Device:SOC Peripherals:MIPI DSI
8989
for-context: +Alif-E7-M55-HP
9090

91-
- component: AlifSemiconductor::Device:SOC Peripherals:CAMERA Controller
91+
- component: AlifSemiconductor::Device:SOC Peripherals:I2C
92+
for-context: +Alif-E7-M55-HP
93+
94+
- component: AlifSemiconductor::Device:SOC Peripherals:CPI
9295
for-context: +Alif-E7-M55-HP
9396

9497
- component: AlifSemiconductor::BSP:External peripherals:ILI9806E LCD panel
9598
for-context: +Alif-E7-M55-HP
9699

97100
- component: AlifSemiconductor::BSP:External peripherals:CAMERA Sensor ARX3A0
98101
for-context: +Alif-E7-M55-HP
102+
103+
- component: AlifSemiconductor::Device:SE runtime Services:core
104+
for-context: +Alif-E7-M55-HP
105+
106+
- component: AlifSemiconductor::Device:SE runtime Services:Initialization Helper
107+
for-context: +Alif-E7-M55-HP
108+
109+

cmsis-pack-examples/device/alif-ensemble/include/CameraCapture.hpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -18,18 +18,22 @@
1818
#ifndef CAMERA_CAPTURE_HPP
1919
#define CAMERA_CAPTURE_HPP
2020

21-
#if defined (__cplusplus)
22-
extern "C" {
23-
#include "Camera_Common.h"
24-
}
25-
#endif
2621
#include <cstdint>
22+
#include "Driver_CPI.h"
23+
#include "RTE_Device.h"
24+
25+
#if !defined(RTE_ARX3A0_CAMERA_SENSOR_FRAME_WIDTH) || !defined(RTE_ARX3A0_CAMERA_SENSOR_FRAME_HEIGHT)
26+
#error "Camera frame dimensions undefined!"
27+
#endif
2728

28-
#define CAMERA_FRAME_WIDTH 560
29-
#define CAMERA_FRAME_HEIGHT 560
30-
#define CAMERA_RESOLUTION CAMERA_RESOLUTION_560x560
29+
#define CAMERA_FRAME_WIDTH RTE_ARX3A0_CAMERA_SENSOR_FRAME_WIDTH
30+
#define CAMERA_FRAME_HEIGHT RTE_ARX3A0_CAMERA_SENSOR_FRAME_HEIGHT
3131
#define CAMERA_IMAGE_RAW_SIZE (CAMERA_FRAME_WIDTH * CAMERA_FRAME_HEIGHT)
3232

33+
#if CAMERA_IMAGE_RAW_SIZE <= 0
34+
#error "Invalid image size"
35+
#endif
36+
3337
namespace arm {
3438
namespace app {
3539

@@ -48,7 +52,7 @@ enum class ColourFilter {
4852
* @param raw_image Pointer to the raw image that can be populated.
4953
* @return int: 0 if successful, error code otherwise
5054
*/
51-
int CameraCaptureInit(ARM_CAMERA_RESOLUTION resolution);
55+
int CameraCaptureInit();
5256

5357
/**
5458
* @brief Starts the camera capture (does not wait for it to finish)

cmsis-pack-examples/device/alif-ensemble/include/GpioSignal.hpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -24,7 +24,7 @@
2424
extern "C" {
2525
#endif // #if defined(__cplusplus)
2626

27-
#include "gpio.h"
27+
#include "gpio_wrapper.h"
2828

2929
#if defined(__cplusplus)
3030
}
@@ -37,14 +37,17 @@ namespace app {
3737
enum class SignalDirection { DirectionOutput = 0, DirectionInput = 1, DirectionInvalid = 2 };
3838

3939
/* Valid GPIO port numbers */
40-
enum class SignalPort { Port1 = 1, Port2 = 2, Port3 = 3 };
40+
enum class SignalPort { Port6 = 6, Port7 = 7, Port12 = 12 };
4141

4242
/* Valid and used GPIO pin number definitions */
4343
enum class SignalPin {
44-
Port1_UserButton1 = 12, /* Wired to SW2 on the board. */
45-
Port3_UserButton2 = 4, /* Wired to SW3 on the board. */
46-
Port1_StatusLED1 = 14, /* LED1 - green. */
47-
Port1_StatusLED2 = 15 /* LED2 - orange. */
44+
Port12_LED0_R = 3, /* LED0 - red. */
45+
Port07_LED0_G = 4, /* LED0 - green. */
46+
Port12_LED0_B = 0, /* LED0 - blue. */
47+
48+
Port06_LED1_R = 2, /* LED0 - red. */
49+
Port06_LED1_G = 4, /* LED0 - green. */
50+
Port06_LED1_B = 6 /* LED0 - blue. */
4851
};
4952

5053
/**

cmsis-pack-examples/device/alif-ensemble/include/LcdDisplay.hpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -26,6 +26,14 @@
2626
#define DIMAGE_Y RTE_PANEL_VACTIVE_LINE
2727
#define RGB_BYTES 3
2828

29+
#if RTE_CDC200_PIXEL_FORMAT==(1)
30+
#define LCD_BYTES_PER_PIXEL (3)
31+
#elif RTE_CDC200_PIXEL_FORMAT==(2)
32+
#define LCD_BYTES_PER_PIXEL (2)
33+
#else // LCD_BYTES_PER_PIXEL
34+
#error "Unsupported RTE_CDC200_PIXEL_FORMAT."
35+
#endif // LCD_BYTES_PER_PIXEL
36+
2937
namespace arm {
3038
namespace app {
3139

cmsis-pack-examples/device/alif-ensemble/src/BoardAudioUtils.cpp

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2023-2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -26,13 +26,13 @@ extern "C" {
2626

2727
#include "RTE_Components.h"
2828
#include "RTE_Device.h"
29-
#include <Driver_PINMUX_AND_PINPAD.h>
29+
#include "pinconf.h"
3030
#include <Driver_SAI.h>
3131
#include CMSIS_device_header
3232

3333
#include <stdio.h>
3434

35-
#define I2S_ADC 2 /* Audio I2S Controller 2 */
35+
#define I2S_ADC 3 /* Audio I2S Controller 3 */
3636
extern ARM_DRIVER_SAI ARM_Driver_SAI_(I2S_ADC);
3737
ARM_DRIVER_SAI* s_i2s_drv;
3838

@@ -45,9 +45,9 @@ static volatile audio_capture_state s_cap_state;
4545

4646
static void set_capture_completed(bool val)
4747
{
48-
NVIC_DisableIRQ((IRQn_Type)I2S2_IRQ);
48+
NVIC_DisableIRQ((IRQn_Type)I2S3_IRQ_IRQn);
4949
s_cap_state.capCompleted = val;
50-
NVIC_EnableIRQ((IRQn_Type)I2S2_IRQ);
50+
NVIC_EnableIRQ((IRQn_Type)I2S3_IRQ_IRQn);
5151
}
5252

5353
static void set_capture_started(bool val)
@@ -77,20 +77,14 @@ static int32_t ConfigureI2SPinMuxPinPad()
7777
{
7878
int32_t status = 0;
7979

80-
// Configure P2_1.I2S2_SDI_A
81-
status |= PINMUX_Config(PORT_NUMBER_2, PIN_NUMBER_1, PINMUX_ALTERNATE_FUNCTION_3);
82-
status |=
83-
PINPAD_Config(PORT_NUMBER_2,
84-
PIN_NUMBER_1,
85-
PAD_FUNCTION_DRIVER_DISABLE_STATE_WITH_PULL_DOWN | PAD_FUNCTION_READ_ENABLE);
80+
/** Configure I2S3_B_WS */
81+
status |= pinconf_set(PORT_8, PIN_7, PINMUX_ALTERNATE_FUNCTION_2, 0);
8682

87-
/* Configure P2_3.I2S2_SCLK_A */
88-
status |= PINMUX_Config(PORT_NUMBER_2, PIN_NUMBER_3, PINMUX_ALTERNATE_FUNCTION_3);
89-
status |= PINPAD_Config(PORT_NUMBER_2, PIN_NUMBER_3, PAD_FUNCTION_READ_ENABLE);
83+
/** Configure I2S3_B_SCLK */
84+
status |= pinconf_set(PORT_8, PIN_6, PINMUX_ALTERNATE_FUNCTION_2, 0);
9085

91-
/* Configure P2_3.I2S2_WS_A */
92-
status |= PINMUX_Config(PORT_NUMBER_2, PIN_NUMBER_4, PINMUX_ALTERNATE_FUNCTION_2);
93-
status |= PINPAD_Config(PORT_NUMBER_2, PIN_NUMBER_4, PAD_FUNCTION_READ_ENABLE);
86+
/** Configure I2S3_B_SDI */
87+
status |= pinconf_set(PORT_9, PIN_0, PINMUX_ALTERNATE_FUNCTION_2, PADCTRL_READ_ENABLE);
9488

9589
return status;
9690
}

0 commit comments

Comments
 (0)