Difference between revisions of "CMSemicon BAT32G133-EVB"

From SEGGER Wiki
Jump to: navigation, search
(Preparing for J-Link)
(Example Project)
Line 44: Line 44:
   
 
== Example Project==
 
== Example Project==
The following example project was created with the SEGGER Embedded Studio project wizard and runs out-of-the-box on the . <br>
+
The following example project was created with the SEGGER Embedded Studio project wizard.<br>
  +
As the option bytes resides in the normal flash area it's not a good idea just to compile and flash.<br>
  +
Make sure that the option bytes are configured in a valid configuration.<br>
  +
In case of the example programs this has been done by modifying the Cortex_M_Startup.s with the following code:<br>
  +
<source lang="asm"> .section .vectors, "a"
  +
// fill to 0xC0 for the flash configuration field
  +
//.fill 0xC0-(_vectors_end-_vectors), 1, 0xFF
  +
.org 0xC0, 0xFF
  +
// 0xc0: WDT Control BYTE
  +
// 0xc1: LVD Control BYTE (C1H)
  +
// 0xc2: HOCO Control BYTE (FRQSEL)
  +
// 0xc3: Flash Protect Control BYTE
  +
// 0xc4: Boot Area Control BYTE
  +
// 0xc5: QSPI flash protect option BYTE
  +
// 0xc6: QSPI flash protect option BYTE0
  +
// 0xc7: QSPI flash protect option BYTE1
  +
OptBytes:
  +
.byte 0xEF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
  +
</source>
  +
 
It is a simple Hello World sample linked into the internal flash.<br>
 
It is a simple Hello World sample linked into the internal flash.<br>
 
====SETUP====
 
====SETUP====
*J-Link software: V7.82b
+
*J-Link software: V
*Embedded Studio: V6.34
+
*Embedded Studio: V
 
*Hardware:
 
*Hardware:
 
*Link:
 
*Link:

Revision as of 10:33, 14 November 2022

This article describes specifics for the CMSemicon BAT32G1xxGx evaluation boards.

BAT32G133-EVB

PICTURE will follow

BAT32G157-EVB

PICTURE will follow

Minimum requirements

  • J-Link software V7.__b or later

Preparing for J-Link

  • Solder Header to the board (row on the side of the Chip)
Device Side J-Link Signal Pin
CLK SWCLK 9
DAT SWDIO 7
RST RESET 15
GND GND 4
VDD VTRef 1

You can use the following command line:

./JLink.exe -Device BAT32G157GK -If SWD -Speed 4000 -autoconnect 1

In case of BAT32G157GK - for other devices adopt the -device setting.

The output should look as follows:
400px

Example Project

The following example project was created with the SEGGER Embedded Studio project wizard.
As the option bytes resides in the normal flash area it's not a good idea just to compile and flash.
Make sure that the option bytes are configured in a valid configuration.
In case of the example programs this has been done by modifying the Cortex_M_Startup.s with the following code:

  .section .vectors, "a"
  // fill to 0xC0 for the flash configuration field
  //.fill 0xC0-(_vectors_end-_vectors), 1, 0xFF
  .org 0xC0, 0xFF
  // 0xc0: WDT Control BYTE
  // 0xc1: LVD Control BYTE (C1H)
  // 0xc2: HOCO Control BYTE (FRQSEL)
  // 0xc3: Flash Protect Control BYTE
  // 0xc4: Boot Area Control BYTE
  // 0xc5: QSPI flash protect option BYTE
  // 0xc6: QSPI flash protect option BYTE0
  // 0xc7: QSPI flash protect option BYTE1
  OptBytes:
  .byte 0xEF, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF

It is a simple Hello World sample linked into the internal flash.

SETUP

  • J-Link software: V
  • Embedded Studio: V
  • Hardware:
  • Link: