2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ESP32のチップ情報を取得する(ESP-IDF)

Posted at

ESP32のチップを判定する必要があったのでその方法をメモしておきます。

ESP-IDFでの例になります。

Chipの取得

#include "soc/soc.h"

    uint32_t _chipmacid =REG_READ(DR_REG_EFUSE_BASE+12);

    char str[30];
    sprintf(str, "_chipmacid:%u\n", _chipmacid);
    console_print(str);

    uint8_t pkg = (_chipmacid >> 9) & 0x07;
    sprintf(str, "pkg:%u\n", pkg);//これがChipID
    console_print(str);
    // 0: "ESP32D0WDQ6",
    // 1: "ESP32D0WDQ5",
    // 2: "ESP32D2WDQ5",
    // 5: "ESP32-PICO-D4",

これでチップの判定をすることができます!

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?