The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
Is possible to use Com1 for debugging and communication?
I was wondering if it is really possible to implement a couple of tricks to use port Com1 for debuggingdeploying purpose and at the same time deploy in the code instructions to use such port for communication? I have no aid from usb, so it counts as it doesn't exist. I just want to know if any member has succeeded to do so and can share some code and hints about how to make it happen. Thanks in advance,
Ps: I tried to do so with my netduino board and result was to only be able to deployed code once and after that no communication whatsoever or chance to upload new code if not flashing the firmware. I can do so if that is the only way of making this work if I can get the port to transmit to Pc using a USB - TTL cable.
Come on people,shed some light here . Some update from what I'm doing: I'm using a FTDI Cable to connect Netduino to pc since the final idea is to connect PC with same atmel chip in a custom Pcb. Being said so, I'm using Com1 to deploydebug at the same time that some code to transmit is uploaded. I successively control when transmit using a flag variable which is toggle using push button interruption, it works very good. Also, I implemented the structure using(SerialPort port = new SerialPort("Com1"....)), then I guarantee that port is being disposed at the end of code at every time is used. However, for the sake of me, I cannot deploy anymore or debug when Com1 is used at least once to transmit some information, even though is being close,dispose, etc...Indeed, my intuition is telling me that something change in the virtual com created from FTDI that VS is not able to use for deploy unless I do a firmware flash (Which is highly desired to be avoided), then this is the point where I'm lost and need some help from the community, please share something.
Darn, not good for my ears, I was hoping some miracle here, I guess I will have to start looking in the other direction unless somebody come forward with some successful experience about it. thanks Dave for sharing your outcome.
Hi Nym,
On Shield Base, we use COM1 to deploy code during testing...and then we change the deployment port to an imaginary COM port for production--so that COM1 is available for apps to use.
For your application, where you're creating a custom board, you can do the same thing. Also, SAM7X has 3 UARTs so you could also have a single UART for deploy/debug which is on exposed pins. Or you could deploy your code via JTAG or other programming means for production.
Chris
Hey Chris Thanks for catching up here with me. It is indeed pretty interesting what you mentioned so question is: What is the third UART on the SAM7x? I'm not aware of that and is very promising; I only know UART 1 & 2 located in the first D pins of netduino for communication, what couple of pins would make the third? Also, if is not a big nightmare for you, can you detail how your team change deployment port on an imaginary one? I received my pcb board and have all elements soldered in already, including Sam7x micro-controller, also I have my FTDI cable ready for action here. Unfortunately, I grounded JTAG port, shame on me. Thanks for the hints
Hi Nym,
If you grab the latest Shield Base firmware source (from the Netduino gen2 source on the Downloads page) you'll see that we enabled a UART which exists on the "higher-pin-count" chips but not on the 64-pin chip. And then we simply point NETMF to that one for deployment
The SAM7X has DBGU (the SAMBA/debug UART) and the more powerful UART1/UART2 ports. Take a look at the SAM7X datasheet on the downloads page, in the pin section, and you should see all the details.
If you just change the # of serial ports in the platform_selector.h file, the source code may already be set up to enable all 3 serialports You may need to tweak HardwareProviders to protect those pins as well.
Chris
What about loading the bootlader to chip using Sam-Ba, Can I do it using DEBUG pins UART too or there is any other combination of pins to do that step. I only one FTDI cable, no rs232 at hand. Also, I'm using the Atmel at91sam7x512 chip and I dont available neither the usb interface or jtag, I didn't expect to be used on my pcb and that was a huge mistake. All I have is UART ports and FTDI cable, what I can do to flash chip, laod the bootloader and load the firmware? Also which firmware would be more suitable in my case of no usb: The Netduino gen 1 or Mini?
You should be able to flash the bootloader using SAM-BA via Debug Unit UART and FTDI cable (unless you have RS-232 level translator in your circuit). After erasing, the AT91SAM7X512 boot program (also called SAM-BA) is executed and in case of unsuccessful USB enumeration it checks UART for auto-baudrate sequence. Unlike USB, it will not appear automatically in SAM-BA dialog on you PC, you have to manually select or enter the correct COM port name in the dialog, you can see it in Device Manager (FTDI virtual com port).
Netduino Mini firmware should work out-of-the-box, it has deployment configured on Debug Unit UART, Netduino gen 1 firmware has to be recompiled because it uses USB by default.
Thanks for the answer. All I did was pull DRXD and DTXD pins from micro to females headers pins so I can use my FTDI cable, no rs232 level translator here .After that I have connected cable TX to header RX, cable RX to header TX and also I read that I should connect cable ground to pcb ground which I'm doing. I have tried to flash around 40 times!! and only two in between I was able to pull off samba but my nerves betrayed me and I upload Netduino gen 1 bootloader which works over USB by default and not Mini variant using UART. Then, I have tried to flash it many times and cannot longer get sam-ba to work. I guess that chip could damage but I check voltage and continuity and everything is perfect,also chip is not getting hot indicating some short.I ordered couple more to replace but in the meanwhile I'm deeply lost here since it should work without issues.
Then, I have tried to flash it many times and cannot longer get sam-ba to work.
Have you erased the microcontroller (3.3V on ERASE pin for more than 220 ms)? Otherwise the SAM-BA boot assistant stored in the microcontroller ROM memory does not run, so SAM-BA PC application cannot communicate with the microcontroller.
yea I have erased chip about 30 times, I have found different steps about how to do so but essentially I'm doing steps recommended on mini link you posted and still no luck....Is there anything missing on the way that I'm connected my UART ports to micro?
Sam-ba always return "No valid processor ID found"
Also nooms helped me out and we check reset,erase pins were correctly implemented.Crystal is rsponding 18.48MHz in the oscilloscope,so chip apparently is working.Let me the samba thing
How can I do so? Sorry for asking so many questions... I have oscilloscope here only I need some guidance to test the TTL cable and what values I should be seen to know that is correct?
Also I'm using https://www.sparkfun.com/products/9717 . Any one other FTDI cable or board that could be better and used by other members. I know that my FTDI is able to debug/deploy and communicate because I have tested on my Netduino gen 1 board but never used sam-ba there since I connect my board using micro-usb port.