![]() |
M480 BSP V3.05.005
The Board Support Package for M480 Series
|
M480 Series Debug Port and Semihost Setting Source File. More...
Go to the source code of this file.
Macros | |
#define | DEBUG_PORT UART0 |
Enumerations | |
enum | { r0 , r1 , r2 , r3 , r12 , lr , pc , psr } |
Functions | |
static void | stackDump (uint32_t stack[]) |
Helper function to dump register while hard fault occurred. More... | |
void | Hard_Fault_Handler (uint32_t stack[]) |
Hard fault handler. More... | |
__asm int32_t | HardFault_Handler (void) |
This HardFault handler is implemented to show r0, r1, r2, r3, r12, lr, pc, psr. More... | |
static void | SendChar_ToUART (int ch) |
Routine to send a char. More... | |
static void | SendChar (int ch) |
Routine to send a char. More... | |
static char | GetChar (void) |
Routine to get a char. More... | |
int | kbhit (void) |
Check any char input from UART. More... | |
int | IsDebugFifoEmpty (void) |
Check if debug message finished. More... | |
void | _ttywrch (int ch) |
C library retargetting. More... | |
int | fputc (int ch, FILE *stream) |
Write character to stream. More... | |
int | fgetc (FILE *stream) |
Get character from UART debug port or semihosting input. More... | |
int | ferror (FILE *stream) |
Check error indicator. More... | |
Variables | |
FILE | __stdout |
FILE | __stdin |
M480 Series Debug Port and Semihost Setting Source File.
SPDX-License-Identifier: Apache-2.0
Definition in file retarget.c.
#define DEBUG_PORT UART0 |
Definition at line 30 of file retarget.c.
anonymous enum |
Enumerator | |
---|---|
r0 | |
r1 | |
r2 | |
r3 | |
r12 | |
lr | |
pc | |
psr |
Definition at line 41 of file retarget.c.
void _ttywrch | ( | int | ch | ) |
C library retargetting.
[in] | ch | Character to send to debug port. |
Check if message finished (FIFO empty of debug port)
Definition at line 637 of file retarget.c.
int ferror | ( | FILE * | stream | ) |
Check error indicator.
[in] | stream | Pointer to a FILE object that identifies the stream. |
Checks if the error indicator associated with stream is set, returning a value different from zero if it is. This indicator is generally set by a previous operation on the stream that failed.
Definition at line 732 of file retarget.c.
int fgetc | ( | FILE * | stream | ) |
Get character from UART debug port or semihosting input.
[in] | stream | Pointer to a FILE object that identifies the stream on which the operation is to be performed. |
For get message from debug port or semihosting.
Definition at line 712 of file retarget.c.
int fputc | ( | int | ch, |
FILE * | stream | ||
) |
Write character to stream.
[in] | ch | Character to be written. The character is passed as its int promotion. |
[in] | stream | Pointer to a FILE object that identifies the stream where the character is to be written. |
Writes a character to the stream and advances the position indicator.
The character is written at the current position of the stream as indicated
by the internal position indicator, which is then advanced one character.
Definition at line 662 of file retarget.c.
|
static |
Routine to get a char.
None |
Wait UART debug port or semihost to input a char.
Definition at line 551 of file retarget.c.
void Hard_Fault_Handler | ( | uint32_t | stack[] | ) |
Hard fault handler.
[in] | stack | pointer points to the dumped registers in SRAM |
Replace while(1) at the end of this function with chip reset if WDT is not enabled for end product
Definition at line 67 of file retarget.c.
__asm int32_t HardFault_Handler | ( | void | ) |
This HardFault handler is implemented to show r0, r1, r2, r3, r12, lr, pc, psr.
None |
The function extracts the location of stack frame and passes it to Hard_Fault_Handler function as a pointer
Definition at line 401 of file retarget.c.
int IsDebugFifoEmpty | ( | void | ) |
Check if debug message finished.
None |
1 | Message is finished |
0 | Message is transmitting. |
Check if message finished (FIFO empty of debug port)
Definition at line 618 of file retarget.c.
int kbhit | ( | void | ) |
Check any char input from UART.
None |
1 | No any char input |
0 | Have some char input |
Check UART RSR RX EMPTY or not to determine if any char input from UART
Definition at line 599 of file retarget.c.
|
static |
Routine to send a char.
[in] | ch | Character to send to debug port. |
Send a target char to UART debug port or semihost.
Definition at line 511 of file retarget.c.
|
static |
Routine to send a char.
[in] | ch | Character to send to debug port. |
Send a target char to UART debug port .
Definition at line 432 of file retarget.c.
|
static |
Helper function to dump register while hard fault occurred.
[in] | stack | pointer points to the dumped registers in SRAM |
This function is implement to print r0, r1, r2, r3, r12, lr, pc, psr
Definition at line 49 of file retarget.c.
FILE __stdin |
Definition at line 38 of file retarget.c.
FILE __stdout |
Definition at line 37 of file retarget.c.