Here is the code of the simplified Blinky example:
The code always goes to the address 0x04, where is no instruction instead to the main function.
Here is the code:
/*
* main.c
*/
#include "hal_stdtypes.h"
typedef volatile struct gioPort
{
uint32 DIR; /**< 0x0000: Data Direction Register */
uint32 DIN; /**< 0x0004: Data Input Register */
uint32 DOUT; /**< 0x0008: Data Output Register */
uint32 DSET; /**< 0x000C: Data Output Set Register */
uint32 DCLR; /**< 0x0010: Data Output Clear Register */
uint32 PDR; /**< 0x0014: Open Drain Register */
uint32 PULDIS; /**< 0x0018: Pullup Disable Register */
uint32 PSL; /**< 0x001C: Pull Up/Down Selection Register */
} gioPORT_t;
#define hetPORT1 ((gioPORT_t *)0xFFF7B84CU)
void gioSetDirection(gioPORT_t *port, uint32 dir)
{
port->DIR = dir;
}
void gioSetPort(gioPORT_t *port, uint32 value)
{
/* USER CODE BEGIN (6) */
/* USER CODE END */
port->DOUT = value;
/* USER CODE BEGIN (7) */
/* USER CODE END */
}
uint32 gioGetPort(gioPORT_t *port)
{
/* USER CODE BEGIN (9) */
/* USER CODE END */
return port->DIN;
}
void main(void) {
gioSetDirection(hetPORT1, 0xFFFFFFFF);
gioSetPort(hetPORT1, gioGetPort(hetPORT1) ^ 0x00000001);
while (1)
{
uint32 cycle = 16000000U;
while ( cycle--){};
gioSetPort(hetPORT1, gioGetPort(hetPORT1) ^ 0x00000001);
}
}
In the dissasably window you can see that the program halts at 0x04:
->00000004: FFFFFFFF .word 0xFFFFFFFF system hangs here, no instruction for processor!
00000008: FFFFFFFF .word 0xFFFFFFFF
0000000c: FFFFFFFF .word 0xFFFFFFFF
00000010: FFFFFFFF .word 0xFFFFFFFF
00000014: FFFFFFFF .word 0xFFFFFFFF
00000018: FFFFFFFF .word 0xFFFFFFFF
0000001c: FFFFFFFF .word 0xFFFFFFFF
gioSetDirection:
here is the summary of compiler flags set:
-mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -g --include_path="C:/ti/ccsv5/tools/compiler/arm_4.9.9/include" --diag_warning=225 --display_error_number --enum_type=packed
and the summary of linker flags set:
-mv7R4 --code_state=32 --float_support=VFPv3D16 --abi=eabi -g --diag_warning=225 --display_error_number --enum_type=packed -z -m"LEDtest.map" -i"C:/ti/ccsv5/tools/compiler/arm_4.9.9/lib" -i"C:/ti/ccsv5/tools/compiler/arm_4.9.9/include" --reread_libs --warn_sections --display_error_number --rom_model --be32
I checked the blinky example code, but didn't find any initialisation missing, so what can be wrong??