"dummy-flash" device tree possible bug?


Diego Sueiro
 

Hi there,

I'm currently working on porting Zephyr to i.MX7 SoC and I'm facing an error with cmake when it is generating the generated_dts_board.h.
I want to use only the sram and in my dts I removed the "zephyr,flash" property. I'm not sure if I'm doing this correctly. If I don't want a flash should I need to set it to a specific entry or just remove the property from the dts?

Error message:
Makefile:854: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
-- Selected BOARD colibri_imx7d_m4
Zephyr version: 1.10.99
Parsing Kconfig tree in <snip>/Kconfig
Using <snip>/tests/shell/build/colibri_imx7d_m4/zephyr/.config as base
-- Generating zephyr/include/generated/generated_dts_board.h
Traceback (most recent call last):
  File "<snip>/scripts/dts/extract_dts_includes.py", line 906, in <module>
    main()
  File "<snip>/scripts/dts/extract_dts_includes.py", line 896, in main
    insert_defs(chosen['zephyr,flash'], defs, load_defs, {})
KeyError: 'zephyr,flash'
CMake Error at <snip>/dts/dts.cmake:111 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  <snip>/cmake/app/boilerplate.cmake:227 (include)
  CMakeLists.txt:1 (include)


I managed to fix the error with this change:
diff --git a/scripts/dts/extract_dts_includes.py b/scripts/dts/extract_dts_includes.py
index e917deb..c03f236 100755
--- a/scripts/dts/extract_dts_includes.py
+++ b/scripts/dts/extract_dts_includes.py
@@ -889,11 +889,13 @@ def main():
         load_defs['CONFIG_FLASH_LOAD_SIZE'] = \
             lookup_defs(part_defs, chosen['zephyr,code-partition'],
                         'PARTITION_SIZE')
+        node_address = chosen['zephyr,flash']
     else:
         load_defs['CONFIG_FLASH_LOAD_OFFSET'] = 0
         load_defs['CONFIG_FLASH_LOAD_SIZE'] = 0
+        node_address = 'dummy-flash'
 
-    insert_defs(chosen['zephyr,flash'], defs, load_defs, {})
+    insert_defs(node_address, defs, load_defs, {})



Regards,

--
*dS
Diego Sueiro

Join devel@lists.zephyrproject.org to automatically receive all group messages.