Interface Serial Modem to ttyS0 in AM1808 Embedded Linux - arm

I need to implement the Serial Modem interfacing with the ttyS0 port of the AM1808.
In AM1808 all these three serial ports are interfaced in following manner.This has been predefined in the driver of TI (8250.c)
ttyS0 : Normal Mode
ttyS1 : loopback Mode
ttyS2 : loopback Mode
Now i want to use ttyS0 serial port for GSM modem. For that I need to configure ttyS0 in full mode.
My pins requirements are as following and i have interfaced the pins as following.
UART0_TX
UART0_RX
UART0_RTS
UART0_CTS
UART0_DCD (this pins are right now on GPIO)
UART0_DTR (this pins are right now on GPIO)
What i should do wether i need to change the driver of TI for the same ?
How i can do it ?
Guide me.

Related

C Programming Change Serial Channel Mode from RS-232 to RS422

I am working on a software for testing serial channels on my setup running on Linux OS. To configure channel settings such as BAUD rate, parity, etc., I used functions in <termios.h>. However, I do not know how to change channel mode from RS-232 to RS-422 mode.
I tried to use functions in <termios.h> and some ioctl commmands.

How to detect when USB is disconnected?

I use a virtual com port for communication between the microcontroller and the computer.
I have mk. stm32h743 self-powered from its own 3.3V power supply. With the help of a cube, I raised a virtual com port. How can you understand that the USB is disconnected from the device ? When you connect Usb, it calls "CDC_Init_FS" and hUsbDeviceFS.dev_state is set to 3, which corresponds to "USBD_STATE_CONFIGURED". But when you disconnect the USB there is no callback "HAL_PCD_DisconnectCallback (PCD_HandleTypeDef * hpcd);"Why "HAL_PCD_DisconnectCallback (PCD_HandleTypeDef * hpcd);" not called when USB is disabled?
I have no way to track Vbus voltages. So I did it like this :
void HAL_PCD_SuspendCallback(PCD_HandleTypeDef hpcd)
{
USBD_LL_Suspend((USBD_HandleTypeDef)hpcd->pData);
__HAL_PCD_GATE_PHYCLOCK(hpcd);
if (hpcd->Init.low_power_enable)
{
SCB->SCR |= (uint32_t)((uint32_t)(SCB_SCR_SLEEPDEEP_Msk |
SCB_SCR_SLEEPONEXIT_Msk));
}
SBD_LL_DevDisconnected(&hUsbDeviceFS);
}
Hello.
I have a problem with USB working properly - USB CDC (Virtual Com Port) with CubeMX HAL after disconnecting the USB cable and connecting again.
For the test I created a project similar to the one presented here - https://www.youtube.com/watch?v=AYICE0gU-Sg using STM32CubeIDE and STM32CubeMX.
The program writes data in the while (1) loop to the USB port after uploading to STM32.
while(1)
{
CDC_Transmit_FS(buffer, sizeof(buffer));
HAL_Delay(1000);
}
The data is written out, visible in Windows 7 (Tera Term).
When I disconnect the USB cable (OTG FS port) and reconnect, Windows sends the message "USB device not recognized".
Data is not received.
In order for the data to be transferred and the cable to be recognized, I must do a Reset on the board.
Hardware:
MCU: STM32H743VIT
Software: STM32CubeIDE v1.2
Firmware package: STM32Cube_FW_H7_V1.7.0
How to make the USB device work all the time correctly (after disconnecting the cable and reconnecting it), so that it is recognized by Windows and data is transferred?

Microcontroller not recognized at USB port when connected via pins

Im having issues with my TI LAUNCHXL-F28379D. I have it connected to the laptop I am trying to send data to/from via pins P19 (SCIBRxD) and P18 (SCIBTxD), as well as GND and 5V via J16, using a USB Type B cord to which I sautered pin connectors. I'm sure power is being supplied to the board as when I plug the 5V cable of the USB cable, the RGB lights and 3 other small ones turn on. However, the Computer does not recognize ithe controller at the port - it only recognizes if if it is connected via the board's Mini-USB port. I've also written a C Program which opens the COM port and reads data - but this does not work without my knowledge of the COM port number, usually found in Device Manager. I cannot get any further in my project without the port number and it is very annoying. I will attempt to resauter a new USB cable, but if there are any other possible solutions, or if I'm doing something wrong, please let me know.
Absolutely all feedback is appreciated!
The SCIBRxD and SCIBTxD pins belong to the SCI peripheral in the microcontroller. This peripheral implements a UART port (a.k.a. COM port, a.k.a. TTL serial port). It is not a USB port. Nothing useful will happen if you connect it to a USB port, because it is not compatible with USB in any way.
USB-to-UART adapters (a.k.a. USB-to-serial adapters) do exist. There is one built into the LaunchPad. The UART side of the adapter is connected to the SCIB pins, and the USB side of the adapter is connected to the USB port.

GSM modem code through serial port

I have been trying to interface GSM modem with serial port (RS232). I access the serial port as /dev/ttyS0 (COM1).
I am unable to send the AT commands to the device using C. I use Linux OS.

ttys0 misses/garbles data while ttyusb0 does not

A program in c using termios works well if the port is ttyusb0, but misses/garbles data if got through ttys0 i.e comport com1.
proogram runs under ubuntu 9.04 & 10.04
Please suggest the remedies cause for this discrepancy.
Garbled serial data is usually due to using the wrong serial speed. The default might be different for the usb port vs normal serial port. Are you calling cfsetispeed and cfsetospeed?
Are you using the same serial cable for both tests? At higher baud rates, a bad cable can result in noise. If ttyusb0 has a short cable between the USB adapter and the device, but ttyS0 is a long ribbon cable, you'd easily see noise on ttyS0 but not ttyusb0.

Resources