-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to add STM32G07x series? #37
Comments
there is only way to add new port: read manual + codebase then update + test it out. Should you get it working, please consider to make an PR |
thanks for quick answer, I tried few things with the commands and addresses but if you could advice me where and how in the code is the best to start the mods, that would be great. I'm stuck in this routine, I guess I have to configure this part of the code to be able to discover the G family: `bool Adafruit_DAP_STM32::select(uint32_t *found_id) { dap_target_prepare(); // Stop the core target_device.flash_size = (dap_read_word(STM32_FLASHSIZE) >> 16) * 1024; *found_id = mcuid = (dap_read_word(DAP_DBGMCU_IDCODE) & 0xFFFUL); if (target_device.name == NULL) return true; |
Hi @laszlokovacs25 laszlokovacs25 |
hi @testerHerbert |
Hi @laszlokovacs25 , |
the only file what need to be modified is the Adafruit_DAP_STM32.cpp
//STM32F4 #define FLASH_BANK2_START_PAGE 256U // Flash Interface Registers*STM32F4 // Flash Interface Registers*STM32G0 ///******************* Bits definition for FLASH_SR register STM32F4**************/ /******************* Bits definition for FLASH_SR register STM32G0**************/ ///******************* Bits definition for FLASH_CR register STM32F4**************/ /******************* Bits definition for FLASH_CR register STM32G0**************/ #define FLASH_CR_PSIZE_WORD (2UL << FLASH_CR_PSIZE_Pos)
// target_device.flash_size = (dap_read_word(STM32_FLASHSIZE) >> 16) * 1024;
// return dap_read_word(FLASH_SR) & FLASH_SR_BSY;
// dap_write_word(FLASH_CR, FLASH_CR_MER | FLASH_CR_STRT | FLASH_CR_PSIZE_WORD);
const uint32_t flash_sectors[] = { // Bank 0 : sector 0-3 : 16 KB, sector 4: 64 KB, sector 5-11: 128 KB // Set SER, Sector Number, and PSize and Start bit const uint32_t ctrl = (sector_count << FLASH_CR_SNB_Pos) | FLASH_CR_SER | (sector_count >= FLASH_BANK2_START_PAGE ? FLASH_CR_BKER : 0);
//dap_write_word(FLASH_CR, FLASH_CR_PG | FLASH_CR_PSIZE_WORD); after all those changes: |
hi,
I'm working on a project where I would like to program an STM32G07x chip with ESP32 but this STM family is not supported now.
Is there a way to add it easily?
I have extended the model here:
struct {
uint32_t mcuid;
const char *name;
} _stm32_devices[] = {
{0x413, "STM32F405xx/07xx and STM32F415xx/17xx"},
{0x419, "STM32F42xxx and STM32F43xxx"},
{0x431, "STM32F411xC/E"},
{0x441, "STM32F412"},
{0x460, "STM32G07x"},
};
but it says:
12:14:47.014 -> Connecting...
12:14:47.014 -> Adafruit Generic CMSIS-DAP Adapter 123456 v0.1 (S)
12:14:47.014 -> No STM32 device found!
thanks
The text was updated successfully, but these errors were encountered: