PlatformIO Community

At end of build, getting TypeError: 'NoneType' object is not iterable

UPDATE Ah dang…forgot to include this:
Windows 10
VSCode
esp-idf (espressif32 latest)
esp-wrover board

what kinds of things would cause the build to fail after getting all the way to the end and during the last couple of steps failing with a:

TypeError: 'NoneType' object is not iterable

I suspect that isn’t the entire error message… can you give the full compile output?

This is the output from the build. I also started a verbose build, i will post both below:

    Indexing .pio\build\esp-wrover16\bootloader\esp-idf\xtensa\libxtensa.a
        *** [.pio\build\esp-wrover16\bootloader.elf] Implicit dependency `C:\Users\admin\.platformio\platforms\espressif32\builder\=' not found, needed by target `.pio\build\esp-wrover16\bootloader.elf'.
        Traceback (most recent call last):
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\ldgen.py", line 150, in <module>
            main()
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\ldgen.py", line 126, in main
            mapping_rules = generation_model.generate_rules(sections_infos)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 354, in generate_rules
            self._create_exclusions(mapping_rules, default_rules, sections_infos)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 448, in _create_exclusions
            general_rule.add_exclusion(specific_rule, sections_info)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 100, in add_exclusion
            expansions = do_section_expansion(self, section)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 84, in do_section_expansion
            expansions = fnmatch.filter(sections_in_obj, section)
          File "C:\Users\admin\.platformio\python37\lib\fnmatch.py", line 59, in filter
            for name in names:
    TypeError: 'NoneType' object is not iterable

Verbose Build

        Traceback (most recent call last):
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\ldgen.py", line 150, in <module>
            main()
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\ldgen.py", line 126, in main
            mapping_rules = generation_model.generate_rules(sections_infos)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 354, in generate_rules
            self._create_exclusions(mapping_rules, default_rules, sections_infos)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 448, in _create_exclusions
            general_rule.add_exclusion(specific_rule, sections_info)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 100, in add_exclusion
            expansions = do_section_expansion(self, section)
          File "C:\Users\admin\.platformio\packages\framework-espidf\tools\ldgen\generation.py", line 84, in do_section_expansion
            expansions = fnmatch.filter(sections_in_obj, section)
          File "C:\Users\admin\.platformio\python37\lib\fnmatch.py", line 59, in filter
            for name in names:
        TypeError: 'NoneType' object is not iterable
        *** [.pio\build\esp-wrover16\esp32.project.ld] Error 1

So I take it (since we’re operating in the dark here)… that this is with the ESPIDF framework, using a ESP-WROVER board (making this espressif32), on Windows?

I also find the earlier error peculiar, as that path (ending) doesn’t look right.

*** [.pio\build\esp-wrover16\bootloader.elf] Implicit dependency `C:\Users\admin\.platformio\platforms\espressif32\builder\=' not found, needed by target `.pio\build\esp-wrover16\bootloader.elf'.

What board type have you specified… better still… what’s your complete platformio.ini (if you can share it)? Maybe there’s a typo there.

1 Like

Board file: wrover board

 {
  "build": {
    "core": "esp32",
    "extra_flags": "-DARDUINO_ESP32_DEV -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue",
    "f_cpu": "240000000L",
    "f_flash": "40000000L",
    "flash_mode": "dio",
    "hwids": [
      [
        "0x0403",
        "0x6010"
      ]
    ],
    "ldscript": "esp32_out.ld",
    "mcu": "esp32",
    "variant": "esp32"
  },
  "connectivity": [
    "wifi",
    "bluetooth",
    "ethernet",
    "can"
  ],
  "debug": {
    "default_tools": [
      "ftdi"
    ],
    "onboard_tools": [
      "ftdi"
    ],
    "openocd_board": "esp32-wrover.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "Espressif esp-wrover16",
  "upload": {
    "flash_size": "16MB",
    "maximum_ram_size": 327680,
    "maximum_size": 16777216,
    "protocol": "esptool",
    "protocols": [
      "esptool",
      "ftdi",
      "esp-prog",
      "olimex-arm-usb-tiny-h",
      "olimex-arm-usb-ocd-h",
      "olimex-arm-usb-ocd",
      "olimex-jtag-tiny",
      "minimodule"
    ],
    "require_upload_port": true,
    "speed": 921600
  },
  "url": "https://espressif.com/en/products/hardware/esp-wrover-kit/overview",
  "vendor": "Espressif"
}

platformio.ini

    [platformio]
    default_envs = esp-wrover16

    [env:esp-wrover16]
    platform = espressif32
    framework = espidf
    board = esp-wrover16
    build_flags = 
       -D CODE_MAJOR_VERSION=1
       -D CODE_MINOR_VERSION=2
       -D CODE_PATCH_VERSION=1
       '-D CODE_TAG_VERSION="rc1"'
       -D CODE_BUILD_NUMBER=38
       -D CONFIG_MQTT_TOPIC_SNAPSHOT='"/snapshot/v2"'
     ;  -D CONFIG_MQTT_TOPIC_HEARTBEAT='"/heartbeat/v2"'
     ;  -D CONFIG_MQTT_TOPIC_VERSION='"/version_check"'
     ;  -D CONFIG_API_PROTOCOL='"https://"'
     ;  -D CONFIG_API_DEVICE_V2='"/device-v2/"'
     ;  -D CONFIG_API_REGISTER_PATH='"register/self"'
    monitor_speed = 115200
    monitor_rts = 0
    monitor_dtr = 0
    board_build.partitions=partition_custom.csv

I figured it out with some help from the community. It appears I was using an old board.json format. I basically took the wrover kit board.json file and have been using it for a few versions of esp-idf and I had a legacy line left that was causing me some issues:

"ldscript": "esp32_out.ld",

1 Like