Implemented UART in accordance with the API definition in softuart.h to allow the example code to access printf() functionality#18
Conversation
|
This is starting down the right path, but there are a couple of big things which need to change. As I described in my email, there should be a function / macro something like This allows you to create two uarts on two different pins which can be used at the same time. Your comments about the API are misleading too. It very much does matter what you return for the queue count. When commenting your ASM, you should align things like cycle counts above each other. |
|
Please write your setup/testing instructions in the form of valid shell commands too. |
| #include <stdio.h> | ||
| #include <uart/api.h> | ||
|
|
||
| //Used for setting the baud rate. |
There was a problem hiding this comment.
Don't define things you are not using at the moment.
I am a little confused as to how you plan to achieve this. |
This is kind of hard but I have tried doing it |
01fcdd0 to
0803a71
Compare
|
Try taking a look at the following regarding cycle comments; |
lib/uart/soft_uart.c
Outdated
|
|
||
| BOOL uartX_set_baud(enum uart_baud rate) | ||
| { | ||
| switch(rate) |
There was a problem hiding this comment.
I actually didn't mean for you to implement all the baud rates, just to return an error when the baud rate was not BAUD_115200. However, as you have already done it now we can leave it here.
4f4d855 to
5076805
Compare
| @@ -0,0 +1,15 @@ | |||
| #!/bin/bash -e | |||
There was a problem hiding this comment.
This download script should probably be shared between all examples. Can you move it into the examples directory and send it as a separate pull request.
There was a problem hiding this comment.
You could then have it as part of the common Makefile..
For fast_uart , git checkout branch_name
sudo minicom -H -w fastuart
You should have the parameters of fastuart set to 115200. You should see the values on the terminal.
The PA2 pin must be connected to the rx pin on the serial adaptor. In this situation , the ground must be the same also. Else you may get receiving errors.
The idea is to use this for debugging purposes. The baud rates is set to 115200 by setting the delay values.
Another important fact is that the console must be first opened up before loading the firmware onto the FX2. This is required for getting a lock on the start and the stop bits since there is no line break attached between the 2 bytes.
Code has been cleaned up and the firmware in the examples directory is extremely small(less than 5-6 lines)
Assembly has been extensively commented.
I would like to merge this with the linux-descriptors branch since this is what I used as a base