Skip to content

Commit 7c216d1

Browse files
iabdalkaderdpgeorge
authored andcommitted
alif/boards/ALIF_ENSEMBLE: Add Alif Ensemble board config.
Signed-off-by: iabdalkader <[email protected]> Signed-off-by: Damien George <[email protected]>
1 parent b79b64a commit 7c216d1

File tree

6 files changed

+172
-0
lines changed

6 files changed

+172
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2024 OpenMV LLC.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "py/mphal.h"
28+
#include "ospi_ext.h"
29+
#include "ospi_flash.h"
30+
31+
const ospi_pin_settings_t ospi_pin_settings = {
32+
.peripheral_number = 1,
33+
.pin_reset = pin_OSPI1_RESET,
34+
.pin_cs = pin_OSPI1_CS,
35+
.pin_clk_p = pin_OSPI1_SCLK,
36+
.pin_clk_n = NULL,
37+
.pin_rwds = pin_OSPI1_RXDS,
38+
.pin_d0 = pin_OSPI1_D0,
39+
.pin_d1 = pin_OSPI1_D1,
40+
.pin_d2 = pin_OSPI1_D2,
41+
.pin_d3 = pin_OSPI1_D3,
42+
.pin_d4 = pin_OSPI1_D4,
43+
.pin_d5 = pin_OSPI1_D5,
44+
.pin_d6 = pin_OSPI1_D6,
45+
.pin_d7 = pin_OSPI1_D7,
46+
};
47+
48+
const ospi_flash_settings_t ospi_flash_settings[] = {
49+
{
50+
.jedec_id = 0x1a5b9d,
51+
.freq_hz = 100000000,
52+
.read_dummy_cycles = 9,
53+
OSPI_FLASH_SETTINGS_IS25,
54+
},
55+
};
56+
const size_t ospi_flash_settings_len = 1;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include "mcu/ensemble.ld.S"
2+
3+
/* Define ROMFS partition locations. */
4+
#if CORE_M55_HP
5+
/* The HP core has access to the external OSPI1 flash and MRAM ROMFS partitions. */
6+
_micropy_hw_romfs_part0_start = 0xc1000000;
7+
_micropy_hw_romfs_part0_size = 16M;
8+
_micropy_hw_romfs_part1_start = ORIGIN(MRAM_FS);
9+
_micropy_hw_romfs_part1_size = LENGTH(MRAM_FS);
10+
#else
11+
/* The HP core has access to the MRAM ROMFS partition. */
12+
_micropy_hw_romfs_part0_start = ORIGIN(MRAM_FS);
13+
_micropy_hw_romfs_part0_size = LENGTH(MRAM_FS);
14+
#endif
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#define MICROPY_HW_BOARD_NAME "Alif Ensemble DevKit"
2+
#define MICROPY_HW_MCU_NAME "AE722F80F55D5XX"
3+
4+
#define MICROPY_HW_ENABLE_UART_REPL (CORE_M55_HP)
5+
#define MICROPY_HW_UART_REPL (4)
6+
#define MICROPY_HW_USB_MSC (1)
7+
#define MICROPY_HW_ENABLE_HW_I2C (1)
8+
9+
// ROMFS partitions
10+
#define MICROPY_HW_ROMFS_ENABLE_PART0 (1)
11+
#define MICROPY_HW_ROMFS_ENABLE_PART1 (CORE_M55_HP)
12+
13+
// I2C buses
14+
#define MICROPY_HW_I2C0_SCL (pin_P0_3)
15+
#define MICROPY_HW_I2C0_SDA (pin_P0_2)
16+
#define MICROPY_HW_I2C1_SCL (pin_P3_7)
17+
#define MICROPY_HW_I2C1_SDA (pin_P3_6)
18+
#define MICROPY_HW_I2C2_SCL (pin_P5_1)
19+
#define MICROPY_HW_I2C2_SDA (pin_P5_0)
20+
#define MICROPY_HW_I2C3_SCL (pin_P1_1)
21+
#define MICROPY_HW_I2C3_SDA (pin_P1_0)
22+
23+
// SPI buses
24+
#define MICROPY_HW_SPI0_MISO (pin_P1_0)
25+
#define MICROPY_HW_SPI0_MOSI (pin_P1_1)
26+
#define MICROPY_HW_SPI0_SCK (pin_P1_2)
27+
#define MICROPY_HW_SPI1_MISO (pin_P2_4)
28+
#define MICROPY_HW_SPI1_MOSI (pin_P2_5)
29+
#define MICROPY_HW_SPI1_SCK (pin_P2_6)
30+
#define MICROPY_HW_SPI2_MISO (pin_P4_2)
31+
#define MICROPY_HW_SPI2_MOSI (pin_P4_3)
32+
#define MICROPY_HW_SPI2_SCK (pin_P4_4)
33+
#define MICROPY_HW_SPI3_MISO (pin_P12_4)
34+
#define MICROPY_HW_SPI3_MOSI (pin_P12_5)
35+
#define MICROPY_HW_SPI3_SCK (pin_P12_6)
36+
#define MICROPY_HW_LPSPI0_MISO (pin_P7_4)
37+
#define MICROPY_HW_LPSPI0_MOSI (pin_P7_5)
38+
#define MICROPY_HW_LPSPI0_SCK (pin_P7_6)
39+
40+
// UART buses
41+
#define MICROPY_HW_UART0_TX (pin_P0_1)
42+
#define MICROPY_HW_UART0_RX (pin_P0_0)
43+
#define MICROPY_HW_UART0_RTS (pin_P0_3)
44+
#define MICROPY_HW_UART0_CTS (pin_P0_2)
45+
#define MICROPY_HW_UART1_TX (pin_P0_5)
46+
#define MICROPY_HW_UART1_RX (pin_P0_4)
47+
#define MICROPY_HW_UART1_RTS (pin_P0_7)
48+
#define MICROPY_HW_UART1_CTS (pin_P0_6)
49+
#define MICROPY_HW_REPL_UART_TX (pin_P12_2)
50+
#define MICROPY_HW_REPL_UART_RX (pin_P12_1)
51+
52+
// This is used for alif.Flash() and USB MSC.
53+
#define MICROPY_HW_FLASH_STORAGE_BASE_ADDR (0)
54+
#define MICROPY_HW_FLASH_STORAGE_BYTES (32 * 1024 * 1024)
55+
#define MICROPY_HW_FLASH_STORAGE_FS_BYTES (16 * 1024 * 1024)
56+
#define MICROPY_HW_FLASH_STORAGE_ROMFS_BYTES (16 * 1024 * 1024)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
MCU_SERIES = E7
2+
MCU_VARIANT = AE722F80F55D5XX
3+
JLINK_DEV = AE722F80F55D5_HP
4+
LD_FILE = boards/ALIF_ENSEMBLE/board.ld.S
5+
6+
ALIF_TOOLKIT_CFG_PART = AE722F80F55D5LS
7+
ALIF_TOOLKIT_CFG_FILE = \"app-device-config-ae7.json\"
8+
9+
MICROPY_FLOAT_IMPL = float
10+
MICROPY_PY_OPENAMP = 1
11+
MICROPY_PY_OPENAMP_REMOTEPROC = 1
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// This file is needed by ospi_xip/source/ospi/ospi_drv.c.
2+
#define OSPI_XIP_ENABLE_AES_DECRYPTION (0)
3+
#define OSPI_XIP_RX_SAMPLE_DELAY (3)
4+
#define OSPI_XIP_DDR_DRIVE_EDGE (1)
5+
#define OSPI_XIP_RXDS_DELAY (12)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# OSP1 flash
2+
OSPI1_RESET,P15_7
3+
OSPI1_CS,P5_7
4+
OSPI1_SCLK,P5_5
5+
OSPI1_D0,P9_5
6+
OSPI1_D1,P9_6
7+
OSPI1_D2,P9_7
8+
OSPI1_D3,P10_0
9+
OSPI1_D4,P10_1
10+
OSPI1_D5,P10_2
11+
OSPI1_D6,P10_3
12+
OSPI1_D7,P10_4
13+
OSPI1_RXDS,P10_7
14+
15+
LED_BLUE,P12_0
16+
LED_RED,P12_3
17+
JOY_LEFT,P15_0
18+
JOY_RIGHT,P15_1
19+
20+
# UART buses
21+
UART0_TX,P0_1
22+
UART0_RX,P0_0
23+
UART0_RTS,P0_3
24+
UART0_CTS,P0_2
25+
UART1_TX,P0_5
26+
UART1_RX,P0_4
27+
UART1_RTS,P0_7
28+
UART1_CTS,P0_6
29+
REPL_UART_TX,P12_2
30+
REPL_UART_RX,P12_1

0 commit comments

Comments
 (0)