> For the complete documentation index, see [llms.txt](https://docs.petoi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.petoi.com/thai/biboard/demo-applications/13.add-hardware-partition-configuration-option-in-arduino-ide.md).

# 13.Add hardware partition configuration option in Arduino IDE

หน่วยความจำแฟลชของบอร์ด ESP32 มี 16M และช่วงของที่อยู่จัดเก็บที่แสดงเป็นเลขฐานสิบหกคือ: 0x0-0x01000000

นี่คือตารางพาร์ติชันที่ระบบกำหนดค่าไว้ ดังแสดงในรูปด้านล่าง:

![](https://3127300255-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQ6a951Q6Jn1Zzt5Ajr%2F-Mchn_zsZZksfuhUccIz%2F-MchvFIkmIVuYEVWN9ct%2Ffenqu_01.png?alt=media\&token=2ad3926d-5fa1-4097-8807-526eadd23980)

ตำแหน่งที่เก็บไฟล์ตารางพาร์ติชันนี้บนคอมพิวเตอร์:

C:\Users\\{YourUserName}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.\*\tools\partitions\large\_spiffs\_16MB.csv

สามารถเห็นได้จากตารางพาร์ติชันด้านบน: พื้นที่ APP0 และพื้นที่ APP1 มีพื้นที่ 4.5M พื้นที่ข้อมูลคือ SPIFFS ขนาด 6.9M

แต่ใน Arduino IDE การกำหนดค่านี้ไม่รวมอยู่ในตัวเลือกการกำหนดค่าพาร์ติชันฮาร์ดแวร์ของโมดูล ESP32 Dev:

![](https://3127300255-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQ6a951Q6Jn1Zzt5Ajr%2F-MclkH-yp3D-VFnNvmjK%2F-MclnVKhlt-zGbnEWCmB%2Ffenqu_02en.png?alt=media\&token=f1e4a7dc-e843-473f-b846-70c641f30678)

เราจำเป็นต้องเพิ่มการกำหนดค่านี้ในโมดูล ESP32 Dev

เปิดไฟล์การกำหนดค่าบอร์ดพัฒนา:

C:\Users\\{YourUserName}\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.\*\boards.txt

ค้นหาชื่อของบอร์ดพัฒนา: esp32.name=ESP32 Dev Module ดังแสดงในรูปด้านล่าง:

![](https://3127300255-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQ6a951Q6Jn1Zzt5Ajr%2F-MchxyFn7s0AHlzhZyrl%2F-Mchz3nNhx0WxXBTBXvr%2Ffenqu_03.png?alt=media\&token=664e4276-4d94-43fe-a750-cc3835c3f0be)

บรรทัดข้อความในการกำหนดค่าพาร์ติชัน ESP32 Dev Module ในไฟล์กำหนดค่า:

```
esp32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728
```

เพิ่มข้อความ 3 บรรทัดต่อไปนี้ใต้บรรทัดนี้:

```
esp32.menu.PartitionScheme.large_spiffs=BiBoard V0(4.5 MB APP with OTA /6.9 MB SPIFFS)
esp32.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB
esp32.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824
```

ต่อไปนี้จะอธิบายความหมายของข้อความสามบรรทัด:

```
esp32.menu.PartitionScheme.large_spiffs=BiBoard V0(4.5 MB APP with OTA /6.9 MB SPIFFS)
```

ชื่อของการกำหนดค่าพาร์ติชัน ESP32 เราตั้งชื่อว่า BiBoard V0 (4.5M APP พร้อม OTA /6.9 MB SPIFFS) หรือสามารถแทนที่ด้วยชื่ออื่นที่คุณคุ้นเคย

```
esp32.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB
```

ข้อมูลไฟล์การกำหนดค่าพาร์ติชัน นคือไฟล์ large\_spiffs\_16MB.csv คุณยังสามารถเขียนไฟล์พาร์ติชั่นเพื่อปรับขนาดไฟล์ของแอพและพื้นที่ข้อมูล

```
esp32.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824
```

ข้อความบรรทัดนี้ระบุว่าขนาดโปรแกรมอัปโหลดสูงสุดคือ 4685824 ไบต์

ลองรวบรวมโปรแกรมอย่างง่ายเพื่อทดสอบว่าการตั้งค่าข้างต้นสำเร็จหรือไม่

เปิด Arduino IDE อีกครั้ง เราจะเห็นว่า BiBoard เพิ่งกำหนดค่า:

<figure><img src="https://3127300255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBR9bYMZnmeFFa1GJLvjM%2Fuploads%2F8YMlHMGLxMPJUH8PLGGH%2Fimage.png?alt=media&amp;token=3e7b96da-d041-4522-a6b5-c7177b39389d" alt=""><figcaption></figcaption></figure>

หลังจากคอมไพล์โปรแกรมแล้วจะได้ผลลัพธ์ดังรูปด้านล่าง

![](https://3127300255-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQ6a951Q6Jn1Zzt5Ajr%2F-Mci9pBn8oiM_bWAurw9%2F-MciBDzLnc9v63bQr_3E%2Ffenqu_0502.png?alt=media\&token=cd3d504e-ba07-464e-abe2-055cd2f1a4c5)

การคอมไพล์เสร็จสมบูรณ์ โดยใช้ Flash ขนาด 213KB (4%) และขนาดสูงสุดที่ใช้งานได้คือ 4,685,824 ไบต์

ในข้อนี้ “4685824 ไบต์” ถูกระบุในบรรทัดที่สามของข้อความที่เพิ่งเพิ่มไปยังไฟล์กำหนดค่า

ถึงตอนนี้ คุณได้ทำการกำหนดค่าบอร์ดพัฒนาที่มีพื้นที่หน่วยความจำแฟลชที่ใหญ่ที่สุดใน Arduino IDE เรียบร้อยแล้ว


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.petoi.com/thai/biboard/demo-applications/13.add-hardware-partition-configuration-option-in-arduino-ide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
