Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPIRAM #23

Open
TyberiusPrime opened this issue Apr 29, 2021 · 1 comment
Open

SPIRAM #23

TyberiusPrime opened this issue Apr 29, 2021 · 1 comment

Comments

@TyberiusPrime
Copy link

So I managed to compile micropython for the Ai-Thinker (using https://github.com/othiman/esp-adf-ac101, but it's the samething right), but it's not using the SPIRAM.

Does anybody know what I need to change to enable it?

@TyberiusPrime
Copy link
Author

Ok, I got it running. Micropython is still only using 4mb of the 8 on the module,
but that's a micropython thing - the boot messages correctly detect 64Mbit of SPIRAM.

Here's the changes I made

diff --git a/micropython_adf/mpadfenv.mk b/micropython_adf/mpadfenv.mk
index 8099d83..d349953 100644
--- a/micropython_adf/mpadfenv.mk
+++ b/micropython_adf/mpadfenv.mk
@@ -36,6 +36,10 @@ endif
 ifdef CONFIG_ESP_LYRAT_MINI_V1_1_BOARD
 INC_ESPCOMP += -I$(ADFCOMP)/audio_board/lyrat_mini_v1_1
 endif
+ifdef CONFIG_ESP_AI_THINKER_V2_2_BOARD
+INC_ESPCOMP += -I$(ADFCOMP)/audio_board/ai_thinker_audio_kit_v2_2/
+endif
+
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/include
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/driver/include
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/driver/es8388
diff --git a/micropython_adf/mpadfobj.mk b/micropython_adf/mpadfobj.mk
index bc8fbeb..91a98c0 100644
--- a/micropython_adf/mpadfobj.mk
+++ b/micropython_adf/mpadfobj.mk
@@ -17,6 +17,10 @@ endif
 ifdef CONFIG_ESP_LYRAT_MINI_V1_1_BOARD
 ESPADF_AUDIO_BOARD_O = $(patsubst %.c,%.o,$(wildcard $(ADFCOMP)/audio_board/lyrat_mini_v1_1/*.c))
 endif
+ifdef CONFIG_ESP_AI_THINKER_V2_2_BOARD
+ESPADF_AUDIO_BOARD_O = $(patsubst %.c,%.o,$(wildcard $(ADFCOMP)/audio_board/ai_thinker_audio_kit_v2_2/*.c))
+endif
+
 ESPADF_AUDIO_HAL_O = $(patsubst %.c,%.o,\
        $(wildcard $(ADFCOMP)/audio_hal/*.c) \
        $(wildcard $(ADFCOMP)/audio_hal/driver/*/*.c) \
diff --git a/micropython_adf/sdkconfig.adf b/micropython_adf/sdkconfig.adf
index 3d55eb0..07290c0 100644
--- a/micropython_adf/sdkconfig.adf
+++ b/micropython_adf/sdkconfig.adf
@@ -1,9 +1,25 @@
 #
 # Audio HAL
 #
-CONFIG_ESP_LYRAT_V4_3_BOARD=y
+CONFIG_ESP_LYRAT_V4_3_BOARD=
 CONFIG_ESP_LYRAT_V4_2_BOARD=
 CONFIG_ESP_LYRATD_MSC_V2_1_BOARD=
                                                                                                    [ 0.000045d 0.001076h 0.064533m 3.872s872 | Apr 29 02:52 ]
finkernagel at ff-home ~/esp32-devel/esp-adf/micropython_adf
> git diff> patch
                                                                                                        [ 0.000001d 0.000017h 0.001m 0.06s060 | Apr 29 02:52 ]
finkernagel at ff-home ~/esp32-devel/esp-adf/micropython_adf
> cat patch 
diff --git a/micropython_adf/mpadfenv.mk b/micropython_adf/mpadfenv.mk
index 8099d83..d349953 100644
--- a/micropython_adf/mpadfenv.mk
+++ b/micropython_adf/mpadfenv.mk
@@ -36,6 +36,10 @@ endif
 ifdef CONFIG_ESP_LYRAT_MINI_V1_1_BOARD
 INC_ESPCOMP += -I$(ADFCOMP)/audio_board/lyrat_mini_v1_1
 endif
+ifdef CONFIG_ESP_AI_THINKER_V2_2_BOARD
+INC_ESPCOMP += -I$(ADFCOMP)/audio_board/ai_thinker_audio_kit_v2_2/
+endif
+
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/include
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/driver/include
 INC_ESPCOMP += -I$(ADFCOMP)/audio_hal/driver/es8388
diff --git a/micropython_adf/mpadfobj.mk b/micropython_adf/mpadfobj.mk
index bc8fbeb..91a98c0 100644
--- a/micropython_adf/mpadfobj.mk
+++ b/micropython_adf/mpadfobj.mk
@@ -17,6 +17,10 @@ endif
 ifdef CONFIG_ESP_LYRAT_MINI_V1_1_BOARD
 ESPADF_AUDIO_BOARD_O = $(patsubst %.c,%.o,$(wildcard $(ADFCOMP)/audio_board/lyrat_mini_v1_1/*.c))
 endif
+ifdef CONFIG_ESP_AI_THINKER_V2_2_BOARD
+ESPADF_AUDIO_BOARD_O = $(patsubst %.c,%.o,$(wildcard $(ADFCOMP)/audio_board/ai_thinker_audio_kit_v2_2/*.c))
+endif
+
 ESPADF_AUDIO_HAL_O = $(patsubst %.c,%.o,\
 	$(wildcard $(ADFCOMP)/audio_hal/*.c) \
 	$(wildcard $(ADFCOMP)/audio_hal/driver/*/*.c) \
diff --git a/micropython_adf/sdkconfig.adf b/micropython_adf/sdkconfig.adf
index 3d55eb0..07290c0 100644
--- a/micropython_adf/sdkconfig.adf
+++ b/micropython_adf/sdkconfig.adf
@@ -1,9 +1,25 @@
 #
 # Audio HAL
 #
-CONFIG_ESP_LYRAT_V4_3_BOARD=y
+CONFIG_ESP_LYRAT_V4_3_BOARD=
 CONFIG_ESP_LYRAT_V4_2_BOARD=
 CONFIG_ESP_LYRATD_MSC_V2_1_BOARD=
 CONFIG_ESP_LYRATD_MSC_V2_2_BOARD=
 CONFIG_ESP_LYRAT_MINI_V1_1_BOARD=
-CONFIG_ESP_LYRAT_SIGHT_V1_0_BOARD=
\ No newline at end of file
+CONFIG_ESP_LYRAT_SIGHT_V1_0_BOARD=
+CONFIG_ESP_AI_THINKER_V2_2_BOARD=y
+
+
+CONFIG_SPIRAM_USE=y
+CONFIG_SPIRAM_SUPPORT=y
+CONFIG_SPIRAM_IGNORE_NOTFOUND=y
+CONFIG_SPIRAM_BOOT_INIT=y
+CONFIG_SPIRAM_USE_MALLOC=y
+CONFIG_SPIRAM_TYPE_AUTO=y
+CONFIG_SPIRAM_SIZE=-1
+CONFIG_SPIRAM_SPEED_80M=y
+CONFIG_SPIRAM_MEMTEST=y
+CONFIG_SPIRAM_CACHE_WORKAROUND=y
+CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384
+CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
+CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant