This repository was archived by the owner on Mar 7, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3838#include "adiv5.h"
3939#include "buffer_utils.h"
4040
41+ /* Chip IDs */
42+ #define ID_PY32F07X 0x06188061U
43+
4144/* Flash */
4245#define PUYA_FLASH_START 0x08000000U
4346#define PUYA_00A_FLASH_PAGE_SIZE 128U
@@ -121,7 +124,7 @@ bool puya_probe(target_s *target)
121124 size_t flash_size = 0U ;
122125
123126 const uint32_t dbg_idcode = target_mem32_read32 (target , PUYA_DBG_IDCODE );
124- if (dbg_idcode == 0x06188061U ) {
127+ if (dbg_idcode == ID_PY32F07X ) {
125128 const uint32_t flash_ram_sz = target_mem32_read32 (target , PUYA_07X_FLASH_RAM_SZ );
126129 flash_size = (((flash_ram_sz >> PUYA_FLASH_SZ_SHIFT ) & PUYA_FLASH_SZ_MASK ) + 1 ) << PUYA_FLASH_UNIT_SHIFT ;
127130 ram_size = (((flash_ram_sz >> PUYA_RAM_SZ_SHIFT ) & PUYA_RAM_SZ_MASK ) + 1 ) << PUYA_RAM_UNIT_SHIFT ;
@@ -150,7 +153,7 @@ bool puya_probe(target_s *target)
150153 flash -> length = flash_size ;
151154 flash -> erase = puya_flash_erase ;
152155 flash -> write = puya_flash_write ;
153- if (dbg_idcode == 0x06188061U ) {
156+ if (dbg_idcode == ID_PY32F07X ) {
154157 flash -> blocksize = PUYA_07X_FLASH_PAGE_SIZE ;
155158 flash -> writesize = PUYA_07X_FLASH_PAGE_SIZE ;
156159 flash -> prepare = puya_07x_flash_prepare ;
You can’t perform that action at this time.
0 commit comments