Skip to content

Commit

Permalink
samples: drivers: memc: Add support for Smartbond Pro DevKit.
Browse files Browse the repository at this point in the history
Add configuration and overlay files to support the DA1469x development kit.

Signed-off-by: Ioannis Karachalios <[email protected]>
  • Loading branch information
ioannis-karachalios committed Jan 24, 2024
1 parent 7790443 commit ed5de93
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
9 changes: 9 additions & 0 deletions samples/drivers/memc/boards/da1469x_dk_pro.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# Copyright (c) 2023 Renesas Electronics Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
#
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_MEMC_LOG_LEVEL_DBG=y
21 changes: 21 additions & 0 deletions samples/drivers/memc/boards/da1469x_dk_pro.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2023 Renesas Electronics Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
sram-ext = &memc;
};
};

&memc {
status = "okay";
is-ram;
dev-size = <(64 * 1024 * 1024)>;
enter-qpi-mode;
rx-inst-mode = <2>;
tx-inst-mode = <2>;
extra-byte-enable;
};
9 changes: 8 additions & 1 deletion samples/drivers/memc/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

#include <zephyr/kernel.h>
#include <string.h>

#if DT_HAS_COMPAT_STATUS_OKAY(nxp_imx_flexspi)
/* Use memc API to get AHB base address for the device */
Expand All @@ -13,6 +14,12 @@
#define MEMC_PORT DT_REG_ADDR(DT_ALIAS(sram_ext))
#define MEMC_BASE memc_flexspi_get_ahb_address(FLEXSPI_DEV, MEMC_PORT, 0)
#define MEMC_SIZE (DT_PROP(DT_ALIAS(sram_ext), size) / 8)
#elif DT_HAS_COMPAT_STATUS_OKAY(renesas_smartbond_nor_psram)
#include <da1469x_config.h>
#define MEMC_BASE MCU_QSPIR_M_BASE
#define MEMC_SIZE (DT_PROP(DT_ALIAS(sram_ext), dev_size) / 8)
#else
#error At least one driver should be selected!
#endif

void dump_memory(uint8_t *p, uint32_t size)
Expand Down Expand Up @@ -53,7 +60,7 @@ int main(void)
memc_write_buffer[i] = (uint8_t)i;
}
printk("Writing to memory region with base %p, size 0x%0x\n\n",
MEMC_BASE, MEMC_SIZE);
(void *)MEMC_BASE, MEMC_SIZE);
/* Copy write buffer into memc region */
for (i = 0, j = 0; j < (MEMC_SIZE / BUF_SIZE); i += BUF_SIZE, j++) {
memcpy(memc + i, memc_write_buffer, BUF_SIZE);
Expand Down

0 comments on commit ed5de93

Please sign in to comment.