• About
  • Public Relations
  • New Product Update/Newsletter
CodeGen32 – Starter Kit A31G226 Example Code Execution
  • Written by manager
  • Written date 2022-05-06 00:00:00
  • Inquire 260958

CodeGen32 – Starter Kit A31G226 Example Code Execution


To make it easier to start ABOV Semiconductor's 32-bit Cortex-M series, we provide CodeGen32 which generates source code and project files, and Starter Kit which has a built-in targeted MCU and Debugger(A-Link) to test the basic functions. In this article, based on the A31G226 Starter Kit which is the ABOV’s 32-bit Cortex-M0+ standard product, we will briefly explain how to create a project through CodeGen32 and to open the project in KEIL MDK ARM to download and run it in the Starter Kit.

First, download CodeGen32 from ABOV’s homepage and decompress and install it. Next, prepare the A31G226 Starter Kit. For compilation and execution, a development environment such as KEIL MDK ARM, IAR EWARM, or Eclipse must be installed, and this article will be described based on the KEIL MDK ARM.


 

[Figure 1] CodeGen32 Example Test Materials


 

[Figure 2] CodeGen32 Example Device Selection Window


 When you launch ABOV CodeGen32, as shown in [Figure 2] below, you can see the Device Selection window. Select "A31G22x" for "Series Name", "A31G224/226Mx" for "Device Name", and "80-LQFP" for "Package Type". When you press the [Generate Project] button, the entire setting screen will appear.



 

  

[Figure 3] Clock Setting


 Next, set up for each peripheral in CodeGen32. On the left side of the window, there is Peripherals tab where you can set the device’s clock. As shown in [Figure 3], if you set "MainOSC" and "PLL" to "Enable", "PLL Output" to "48 MHz”, and "Input" of all "MCCRs" except for "WDT" and "WT" to "MCLK", you can see that “AHB CLOCK” and “APB CLOCK” of Clock Configuration will be switched to “48MHz”.


 

[Figure 4] Package pin Setting

 As shown in [Figure 4], you can set the device’s pins in the Package window. Switch "PF0" pin to "XIN", "PF1" pin to "XOUT", "PF2" pin to "SXIN", and "PF3" pin to "SXOUT", respectively.


 

[Figure 5] USART and GPIO Settings



 For debug message output, as shown in the left side of the [Figure 5], set "USART10" to "Enable", "Mode" to "ASync", "Parity" to "-", "bit Count" to "8", and "Baudrate" to "38400", respectively, so that you can see the debug message of the Starter Kit later on the Tera Term. In addition, to use "GPIO-E" as an LED, set the "In/Out" method of "PE2" through "PE7" to "Pushpull out".


 

[Figure 6] Setting up example options


 To create a demo project for the Starter Kit, select "OPTION" in the Peripherals window as shown in [Figure 6] and activate "GPIO LED Blinky" and "Debug Message". Since USART10 is connected to A-Link serial communication port built in A31G226 Starter Kit, select “USART10” for “Debug Port”. The "UART/USART Echo" function is to echo back serial communication data using the terminal, but we do not use it this time, so set it to “Disable”.


 

 

[Figure 7] Creating target projects and source codes


If you click the “Source Gen.” button at the top of the program, you can select "Target Compiler" as either “KEIL", "IAR", or "Eclipse", as shown in [Figure 7]. In this example, select “KEIL”, enter the project name and location below and click the [OK] button to generate codes. In this step, the codes will overwrite everything in the selected folder, so be careful.



 

 

[Figure 8] Setting KEIL Debug Options


In the folder created, double click the "KEIL_proj.uvprojx" file to launch KEIL and to load the project. If you press the [Options for Target] button to open the Settings window, you can see the “Debug” tab. Check if “CMSIS-DAP Debugger” is selected. Then, press the [Setting] button next to and check if “ARM CoreSight SW-DP” is on “SW Device” list. Afterwards, check whether “A31G226 256KB” is under the “Flash Download” tab as shown in [Figure 8].  

After setting up, click the [Start/Stop Debug Session] button to switch to debug mode and press the [Run] button to execute the sample program in the Starter Kit.

 

 

[Figure 9] Run LED Blinky and output message on terminal


The Starter Kit executes the corresponding sample programs so that the LEDs on the lower end of the Starter Kit flash sequentially as shown on the left side of [Figure 9]. If you launch Tera Term and set it the same way as the previous CodeGen32, the relevant contents will be displayed as shown on the right side of the [Figure 9] whenever the LED of the Starter Kit flashes.


For more detailed instruction, please refer to the video titled “How to Use the CodeGen32 – A31G226 Starter Kit”. 


Go to CodeGen32 Video

List





Previous How to Use E-PGM+ ③
Next ABOV Semiconductor releases a new Touch MCU that operates at low voltages with a...