How to write to UART1 in Freescale p1022 using U-Boot? - uart

I know that UART0 is used as U-Boot's console input and output. I would like to be able to write data to the UART1, which is connected with another device, but I cannot find how to configure U-Boot to use it.

Related

LTC6810 Battery Management system CRC error in SPI communication

I'm working on a BMS project for an electric car. I'm using LTC6804-2 for voltage and temperature measurement in each cells. As a first step of development, I would like to establish a successful communication with the monitoring IC (LTC6804-2). So, I'm sending set config register command and trying to read back the config register values that I have written. If I receive the configuration register values without a CRC error, I consider my communication as successful.
In my case, I do not receive expected register values with proper CRC when I read back. Let me break down my situation into small segments.
I'm working on a custom BMS board for this project(LTC6804-2 and STM32F072). I will attach the schematics below. To test my code, I tested my program with DC1942C demo board and arduino UNO. And it is working fine. I can read back the config register and I can calculate the cell voltage and Auxiliary values.
When I try to implement the same program in my custom BMS board, I'm not getting the correct values. I always get CRC error in the received data.
Following the guidelines from the Analog Devices forum, I tested the Vref2 value after sending the config register command, and the voltage goes up to ~3V as expected. So the IC is receiving the message properly. But Why it is not transmitting back?
Below are the captures from the demo board and BMS custom board.
Register read capture from Arduino Uno and demo board DC1942C
Register read capture from the custom board
In fact I tested the program with STM32 development board and DC1942 demo board, I get the correct values.
Thank you for your help. If you want any additional details, please let me know.
LTC6810-2 datasheet

STM32 HAL USB CDC Control Data Decoding / Open Port Detection

I get lost trying to figure out how to parse control data in CDC_Control_FS() function. Can you point me any documentation about that?
Background:
I am using stm32f103, trying to implement USB CDC communication with HAL libraries. I need to detect if usb port is opened by PC, it should handle power on scenario as well as cable reconnetion during runtime. After some research I think that checking DTR signal may be the (most elegant) solution. I know there is CDC_Control_FS() function that delivers all line configuration to stm32f103 from PC driver, but unfortunately I don't know data format / how to extract DTR signal, to be able to set some flag for indicating that usb port is currently open or closed.

STm32 and GPS module

Can anyone please explain how to establish a communication between stm32 dev board and gps module? I am not knowing how to send AT commands to gps module through MC through a source file through UART. Please clarify me in this aspect.
There is a lot of literature on STM32 and UARTs on the web. If I were you I would download the STM32CubeMX. This program generates most of the code for you. You select your processor (or development board), select the clocks and peripherals, and click Generate Code. It also comes with very handy example projects, and might even have a complete project with a working UART that you can put straight onto your board.
And I would first make sure my UART is fully working before connecting the GPS. This you can do by trying to echo. Connect your TX and RX pins with a wire. Then, everything you transmit you will receive as well. It's a easy test to see if everything is working.
I would also work through the TrueStudio IDE. It basically works plug and play
If you use the ublox module, you must use a serial port to communicate.
You have to connect RXD(ublox) to TXD(micro) and TXD(Ublox) to RXD(micro) ,
and config your StmCubemx like This :
http://wiki.sunfounder.cc/index.php?title=Ublox_NEO-6M_GPS_Module
Config Stm32 :
[Step 1: https://i.stack.imgur.com/1B4Ed.jpg ]
[Step 2: https://i.stack.imgur.com/6ULOm.jpg]
[Step 3: https://i.stack.imgur.com/GD0VL.jpg]
If you have another question, please ask
First of all, I think you should test AT command with module sim through (USB to UART) to PC in order to understand procedure operation, such as: module sim - TCP/IP - thingspeak server. The next time, you can refer this link for code: https://bitbucket.org/mbari_peter/sim800-mqtt-ravi/src/78e36076c89b4618cf57a538f0c70f91b2b876dd/modemDrivers.ino?at=master&fileviewer=file-view-default
If you have any questions or encounter any problems, you can ask! Thanks for reading!
Typically, GPS sends data # 1 Hz after starting up. You just need to capture this NMEA sentences and filter the receive buffer according to your requirement.
Try using UART receive interrupt. Make sure the baud rate of both GPS module and STM32 are same.

Bluetooth HCI command for enabling BLE advertising

I am currently trying to write some test scripts to get a bluetooth device fcc certified. I have been following these two sites http://processors.wiki.ti.com/index.php/CC256x_VS_HCI_Commands,
http://processors.wiki.ti.com/index.php/WL18xx_Bluedroid_Bluetooth_RF_Testing. I've been using the later to convert commands from the former into tests that the bluedroid test tool will recognize. I have had success for the most part, but I need away to turn on BLE advertising mode and cannot find a way to do it. The bluetooth chip I am using is a Pan13xx from Panasonic. If anyone could point me in the right direction that would be amazing.
Thanks in advance.
I haven't tried this, but according to the Bluetooth 4.2 spec (Vol 2, Part E, 7.8.9 Page 1284):
HCI_LE_Set_Advertise_Enable is the command for starting/stopping advertising.
It takes an Advertising_Enable parameter which is defined as:
0x00: Advertising is disabled (default)
0x01: Advertising is enabled.
0x02 – 0xFF: Reserved for future use Value
and returns Status which is defined as:
0x00: LE_Set_Advertise_Enable command succeeded
0x01 – 0xFF: LE_Set_Advertise_Enable command failed

USB HID device detection

I am trying to access an USB HID device under Ubuntu(kernel-3.0). I want to write a program which could notify me whenever an USB device is attached to the bus i.e is there any event generated whenever an USB device is plugged in which I can monitor. I have looked into DBus and HAL without any success. But I don't want linux to load its current modules(USBHID and HID) when the device is plugged in. I also want to ask if the mentioned modules are also the device drivers used for HID devices.
My sole purpose is to run a script whenever an USB device is plugged into the bus which will indirectly call the above mentioned modules.
I am writing my code in C. I am quite new to linux. So it would be of great help if anyone could point me in the right direction.
Thanks..
The UDisks deamon will send the D-Bus signal "DeviceAdded" when a USB drive is inserted, and probably another "DeviceAdded" for each partition on the drive. If you have automount you would also get a "DeviceChanged" signal when the partition(s) are mounted. You can then query the UDisks interface, as well as individual devices about their properties, for example. You can find more info on the UDisks interface here: http://hal.freedesktop.org/docs/udisks/UDisks.html
One way to get more familiar with what goes on with block devices (or whatever) on D-Bus, is to install and use D-Feet to inspect the bus. UDisks appear on the System bus. You can see what is there and inspect the properties for individual devices as well as the UDisks interface itself.
Another way, which would also allow you to see what signals are transmitted on the bus, is to run dbus-monitor from the command line.