navry
Newbie level 3

Hi,
I try to run my first simple C application in Cortex-M1 builded on ProAsic3L FPGA, but encountered some difficulties.
In this first project I want just to read 10 switches and turn on/off 10 LEDs. I created Cortex-M1 with peripherals from Actel IPcores. It has CortexM1 core, CoreAHBLite, CoreMemCtrl, CoreAHB2APB, CoreAhbSram, CoreAPB and CoreGPIO. In this case I think that memory map is important.
CoreAHBLite has:
CoreAPB has:
I can synthesize it and load into FPGA. Then I use SoftConsole IDE to prepare application, it is simple, but I'm not sure if correct:
I build it in Debug and tried to debug, but all what I see is the console output:
Could you give me any hint what to do with it?
I try to run my first simple C application in Cortex-M1 builded on ProAsic3L FPGA, but encountered some difficulties.
In this first project I want just to read 10 switches and turn on/off 10 LEDs. I created Cortex-M1 with peripherals from Actel IPcores. It has CortexM1 core, CoreAHBLite, CoreMemCtrl, CoreAHB2APB, CoreAhbSram, CoreAPB and CoreGPIO. In this case I think that memory map is important.
CoreAHBLite has:
Code:
Core Address Slot
CoreMemCtrl 0x00000000 0
CoreAhbSram 0x20000000 2
CoreAHB2APB 0xA0000000 10
CoreAPB has:
Code:
Core Addreess Slot
CoreGPIO 0xA0000000 0
I can synthesize it and load into FPGA. Then I use SoftConsole IDE to prepare application, it is simple, but I'm not sure if correct:
Code:
#include "hal.h"
#include "CortexM1_Top_hw_platform.h"
#include "core_gpio.h"
#define GPOUT_INIT_STATE 0x00000000
gpio_instance_t g_gpio;
int main()
{
uint32_t io_state;
/**************************************************************************
* Initialize the CoreGPIO driver with the base address of the CoreGPIO
* instance to use and the initial state of the outputs.
*************************************************************************/
GPIO_init( &g_gpio, COREGPIO_BASE_ADDR, GPOUT_INIT_STATE );
while( 1 )
{
/**********************************************************************
* Read inputs.
*********************************************************************/
io_state = GPIO_get_input( &g_gpio );
/**********************************************************************
* Write state of inputs back to the outputs.
*********************************************************************/
GPIO_set_output( &g_gpio, io_state );
}
}
I build it in Debug and tried to debug, but all what I see is the console output:
Code:
source .gdbinit
set arm fallback-mode thumb
target remote | "C:/Microsemi/Libero_v11.4/SoftConsole/Eclipse//../Sourcery-G++/bin/arm-none-eabi-sprite" flashpro:?cpu=Cortex-M1 "C:/Users/ds/Documents/FPGA/CortexM1_Test2/SoftConsole/CortexM1_Top_CortexM1Top_0/CortexM1_Top_CortexM1Top_0_app/Debug"
arm-none-eabi-sprite: Using memory map C:/Users/ds/Documents/FPGA/CortexM1_Test2/SoftConsole/CortexM1_Top_CortexM1Top_0/CortexM1_Top_CortexM1Top_0_app/Debug/memory-map.xml
arm-none-eabi-sprite: Target reset
0x00000000 in __text_start ()
set mem inaccessible-by-default off
load
Loading section .text, size 0x2f4 lma 0x0
Loading section .data, size 0x4 lma 0x2f4
Start address 0x64, load size 760
Transfer rate: 18 KB/sec, 380 bytes/write.
monitor debug-reset
thb main
Hardware assisted breakpoint 1 at 0x36: file ../main.c, line 18.
cont
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000000 in __text_start ()
Could you give me any hint what to do with it?