Skip to content

Samsung: uart fixes #13674

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/PeripheralNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ typedef enum {
#define _UART_NAME(a, b) _UART_NAME_(a, b)

#ifndef UART_STDIO_PORT
#define STDIO_UART_TX UART_TX0
#define STDIO_UART_RX UART_RX0
#define STDIO_UART UART_0
#define STDIO_UART_TX UART2_TX
#define STDIO_UART_RX UART2_RX
#define STDIO_UART UART_2
#else
#define STDIO_UART_TX _UART_NAME(UART_TX, UART_STDIO_PORT)
#define STDIO_UART_RX _UART_NAME(UART_RX, UART_STDIO_PORT)
#define STDIO_UART _UART_NAME(UART_, UART_STDIO_PORT)
#endif

#define USBTX UART_TX0
#define USBRX UART_RX0
#define USBTX UART2_TX
#define USBRX UART2_RX

#ifdef __cplusplus
}
Expand Down
2 changes: 0 additions & 2 deletions targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/PinNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ typedef enum {
ECG_INP,
ECG_INN,

UART_TX0 = GPIO24,
UART_RX0 = GPIO25,
AN0 = GPA0_INP,
AN1 = GPA1_INP,
AN2 = GPA24_INP0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#endif

#if !defined(MBED_ROM_SIZE)
#define MBED_ROM_SIZE 0x200000 // 2MB KB
#define MBED_ROM_SIZE 0x200000 // 2 MB
#endif

#if !defined(MBED_RAM_START)
Expand All @@ -52,7 +52,7 @@
#define MBED_APP_START 0x00000000
#endif
#if !defined(MBED_APP_SIZE)
#define MBED_APP_SIZE 0x0080000 //512K
#define MBED_APP_SIZE 0x0080000 //512KB
#endif

#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@
#endif

#if !defined(MBED_ROM_SIZE)
#define MBED_ROM_SIZE 0x200000 // 2MB KB
#define MBED_ROM_SIZE 0x200000 // 2MB
#endif

#if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000
#endif

#if !defined(MBED_RAM_SIZE)
#define MBED_RAM_SIZE 0x40000 // 256 KB
#define MBED_RAM_SIZE 0x40000 // 25KB
#endif

#if !defined(MBED_APP_START)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static void peripheral_init(void)
{
/*AFE Voltage Config */
putreg32(&BP_AFE_TOP->REF_CTRL, 0x7A68201F);
putreg32(&BP_AFE_TOP->AFE_CLK_CTRL, 0x0);
putreg32(&BP_AFE_TOP->AFE_CLK_CTRL, 0x08);
}

void SystemCoreClockUpdate(void) /* Get Core Clock Frequency */
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_Samsung/TARGET_SIDK_S1SBP6A/serial_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void serial_baud(serial_t *obj, int baudrate)
struct serial_s *objs = serial_s(obj);
float fFrac = 0;
float fDiv = 0;
uint32_t Peri_Clock = bp6a_cmu_get_clock_freq(CMU_UART0_CLK);
uint32_t Peri_Clock = bp6a_cmu_get_clock_freq(CMU_UART0_CLK + obj->index);

fDiv = ((float)Peri_Clock / ((float)baudrate * 16)) - (float)1.0;
fFrac = (uint32_t)((fDiv - (int32_t)fDiv) * 16.0f);
Expand Down Expand Up @@ -215,7 +215,7 @@ void uart1_irq(void)

void uart2_irq(void)
{
uint32_t uints = getreg32(BP_UART0_BASE + UART_UINTP_OFFSET);
uint32_t uints = getreg32(BP_UART2_BASE + UART_UINTP_OFFSET);

if (uints & UART_UINTS_RXD_MASK) {
_uart_irq_handler(RxIrq, 2);
Expand Down