Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Trying to connect to serial port Bambino Bambino 200e #13

Closed
chrisbrent opened this issue Jun 21, 2016 · 24 comments
Closed

Trying to connect to serial port Bambino Bambino 200e #13

chrisbrent opened this issue Jun 21, 2016 · 24 comments

Comments

@chrisbrent
Copy link
Contributor

chrisbrent commented Jun 21, 2016

Hi,
I have a Bambino 200E and am able to compile the current Smoothie2. When I look in the Kernel I see that it starts this->serial = new SerialConsole(P3_4, P3_5, 9600) I'm trying to work out where P3_4 and P3_5 end up on the Bambino. Looking at the Bambino pin aliases XLS here http://wiki.micromint.com/index.php/Bambino_Documentation I don't see these pins. I tried hooking up to UART0_RX and UART0_TX at 9600 but Pronterface just says "Connecting....." forever. I've tried looking at the schematic http://www.micromint.com/updates/bambino/SCH-BAM200-B.pdf I see the pins labeled P3_4 and P3_5 but I can't work out how these map to the gadgeteer ports.
I'm updating the bambino using:
boot_lpcscrypt
lpcscrypt program ./LPC4330_M4/Smoothie2.hex SPIFI

Should that be the bin file I flash? I get no leds after flashing either file. I can flash the demo blink file using lpcscrypt so that part seems to be working.
What should I try next?

@adamgreen
Copy link
Collaborator

I would start by reading my comments on issue #12 (comment)

I have some experience with the Bambino210E which is the mbed compatible board but not the Bambino200 which is the Microsoft Gadgeteer compatible board so I am not certain about the UART. It doesn't look like you can use P3_4/P3_5 on that Bambino200 board for serial though since it looks like those pins are used for interfacing to the SPIFI flash. Where on the board are you trying to connect to get serial output? That would indicate which pins you should specify in that SerialConsole constructor.

@adamgreen adamgreen self-assigned this Jun 21, 2016
@chrisbrent
Copy link
Contributor Author

Hi Adam,
After writing this I found http://wiki.micromint.com/index.php/Bambino-200_Manual/User_Interfaces,_Connectors,_and_Jumpers and noticed the same thing as you. I changed the SerialConsole constructor to use new SerialConsole(P6_5, P6_4, 9600) which should map to pin 4 and 5 on socket 2 (or I, P, S, U, Y in gadgeteer speak) I still can't get anything from the console. I've also changed the secondary console to new SerialConsole(P2_11, P2_10, 9600) which should map to pins 5 and 4 on socket 10, the tx and rx are flashing on my FTDI adaptor but I can't connect. Now I think the adapter is failing so I'm getting a new one. After reading the other comment I added the +c option to lpcscrypt and now I see the main LED's flash too! Getting closer. Also I ordered the 200 on Arthur's recommendation, should i get a 210 instead?

@adamgreen
Copy link
Collaborator

Sounds like you are making progress then.

You don't say if you modified your makefile as I indicated in the comment on issue #12 to build for the LPC4330 in your Bambino board instead of the LPC4337 in the Smoothie2 hardware.

Also I ordered the 200 on Arthur's recommendation, should i get a 210 instead?

I would give more weight to Arthur's recommendation than mine :)

@chrisbrent
Copy link
Contributor Author

Hi Adam,
Yes I did comment out that line in the makefile, although I'm not sure if that or using +c to lpscrypt was the fix.

@arthurwolf
Copy link
Contributor

If/When you get it to work, it'd be great if you added "how" to the
Smoothie2 readme, I'm sure it'd be of help to others the same way Adam's
Smoothie2Notes have.

On Wed, Jun 22, 2016 at 10:15 PM, chrisbrent notifications@github.com
wrote:

Hi Adam,
Yes I did comment out that line in the makefile, although I'm not sure if
that or using +c to lpscrypt was the fix.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFW2x1ds3Yo0ojiRLoXKyctfnI6k8ks5qOZfRgaJpZM4I6WxX
.

Courage et bonne humeur.

@chrisbrent
Copy link
Contributor Author

Sure thing @arthurwolf That's also why I opened it as an issue, that way i can keep track of what I've tried :)

@adamgreen adamgreen removed their assignment Jun 22, 2016
@adamgreen
Copy link
Collaborator

@chrisbrent Let us know how you progress once you have the new USB to serial adapter.

@chrisbrent
Copy link
Contributor Author

No luck on either port with the new USB to serial adaptor. I can conform it's working as I hooked it up to my old one and could send chars both ways. Are the blinking LED's actually telling be anything. They're alternating between LED1 and LED2 on the Bambino. I can confirm that I had to comment out the memory model as per #12 (comment) to get the led's to blink. I'm not sure what else to try now. I got the jtag header on this board, but don't have a debugger for it.

@arthurwolf
Copy link
Contributor

I have a JTAG debugger I could lend you ...

On Thu, Jun 23, 2016 at 11:17 PM, chrisbrent notifications@github.com
wrote:

No luck on either port with the new USB to serial adaptor. I can conform
it's working as I hooked it up to my old one and could send chars both
ways. Are the blinking LED's actually telling be anything. They're
alternating between LED1 and LED2 on the Bambino. I can confirm that I had
to comment out the memory model as per #12 (comment)
#12 (comment)
to get the led's to blink. I'm not sure what else to try now. I got the
jtag header on this board, but don't have a debugger for it.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFZMA6myOzSoxGIhoW14VzVHJ96omks5qOvfrgaJpZM4I6WxX
.

Courage et bonne humeur.

@adamgreen
Copy link
Collaborator

@chrisbrent I don't have a Bambino 200 with which to do any debugging on this end so there is probably a limit of what I can do to help out with these issues.

@arthurwolf would know better than me which LED means what with the current Smoothie2 firmware. Which LEDs connected to which GPIO pins do you see flash?

Can you describe how you connect your USB to serial adapter up to your Bambino? Did you connect RX, TX, and Ground to your adapter? Can you verify that your adapter works with some other UART enabled hardware? Arthur, what commands should Chris be able to send from a terminal application to get a response from the firmware as it currently exists?

@arthurwolf
Copy link
Contributor

I don't think the LEDs do much in the current firmware. I don't expect them
to blink, none of the code that does that has been ported.

On Thu, Jun 23, 2016 at 11:53 PM, Adam Green notifications@github.com
wrote:

@chrisbrent https://github.com/chrisbrent I don't have a Bambino 200
with which to do any debugging on this end so there is probably a limit of
what I can do to help out with these issues.

@arthurwolf https://github.com/arthurwolf would know better than me
which LED means what with the current Smoothie2 firmware. Which LEDs
connected to which GPIO pins do you see flash?

Can you describe how you connect your USB to serial adapter up to your
Bambino? Did you connect RX, TX, and Ground to your adapter? Can you verify
that your adapter works with some other UART enabled hardware? Arthur, what
commands should Chris be able to send from a terminal application to get a
response from the firmware as it currently exists?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFfvJBk3a5ocrpbaQ24KFOH_Vgo2hks5qOwBGgaJpZM4I6WxX
.

Courage et bonne humeur.

@arthurwolf
Copy link
Contributor

Sending G1 X10 should answer "ok", I think it's the simplest test one can
do.

On Thu, Jun 23, 2016 at 11:55 PM, Arthur Wolf wolf.arthur@gmail.com wrote:

I don't think the LEDs do much in the current firmware. I don't expect
them to blink, none of the code that does that has been ported.

On Thu, Jun 23, 2016 at 11:53 PM, Adam Green notifications@github.com
wrote:

@chrisbrent https://github.com/chrisbrent I don't have a Bambino 200
with which to do any debugging on this end so there is probably a limit of
what I can do to help out with these issues.

@arthurwolf https://github.com/arthurwolf would know better than me
which LED means what with the current Smoothie2 firmware. Which LEDs
connected to which GPIO pins do you see flash?

Can you describe how you connect your USB to serial adapter up to your
Bambino? Did you connect RX, TX, and Ground to your adapter? Can you verify
that your adapter works with some other UART enabled hardware? Arthur, what
commands should Chris be able to send from a terminal application to get a
response from the firmware as it currently exists?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFfvJBk3a5ocrpbaQ24KFOH_Vgo2hks5qOwBGgaJpZM4I6WxX
.

Courage et bonne humeur.

Courage et bonne humeur.

@adamgreen
Copy link
Collaborator

@arthurwolf Thanks for the info

@chrisbrent
Copy link
Contributor Author

Thanks guys. I'm trying this out whenever I have a spare ten minutes. I'll
spend some proper time on it next week. I must be able to debug this
somehow.

On Thu, Jun 23, 2016 at 2:56 PM, Adam Green notifications@github.com
wrote:

@arthurwolf https://github.com/arthurwolf Thanks for the info


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAihOms9qlUpevj4anMmlbMpkhv4FQ3Lks5qOwESgaJpZM4I6WxX
.

@chrisbrent
Copy link
Contributor Author

Just confirming I can communicate with my current Smoothie1 over serial so at least i can work that out :)

@chrisbrent
Copy link
Contributor Author

Fixed! Two issues. One is that the SerialConsole constructor has the pins labeled as rx,tx ie:
SerialConsole::SerialConsole( PinName rx_pin, PinName tx_pin, int baud_rate ){
this->serial = new mbed::Serial( rx_pin, tx_pin );
this->serial->baud(baud_rate);
}
The mBed Serial class constructor is:
Serial (PinName tx, PinName rx, const char * name = NULL )
The Bambino was freaking out when they were around the wrong way, which is what happens in the code above. This is why the Led were flashing.
Secondly I couldn't see the ON_MAIN_LOOP firing, after a lot of searching(led debugging and then adding serial printf's to the Kernel etc) I noticed that I couldn't log anything after the SerialConsole module loaded. In it's on_module_loaded it does:
THEKERNEL->streams->append_stream(this);
but the StreamOutputPool wasn't called in the Kernel until much later. I moved the stream initialization to before the SerialConsole and I'm now getting G code responses! Yay!
screenshot 2016-06-27 12 42 23
I'll send pull requests for the fixes once I take out my hacky debugging.

@arthurwolf
Copy link
Contributor

Great \o/

On Mon, Jun 27, 2016 at 9:43 PM, chrisbrent notifications@github.com
wrote:

Fixed! Two issues. One is that the SerialConsole constructor has the pins
labeled as rx,tx ie:
SerialConsole::SerialConsole( PinName rx_pin, PinName tx_pin, int
baud_rate ){
this->serial = new mbed::Serial( rx_pin, tx_pin );
this->serial->baud(baud_rate);
}
The mBed Serial class constructor is:
Serial (PinName tx, PinName rx, const char * name = NULL )
The Bambino was freaking out when they were around the wrong way, which is
what happens in the code above. This is why the Led were flashing.
Secondly I couldn't see the ON_MAIN_LOOP firing, after a lot of
searching(led debugging and then adding serial printf's to the Kernel etc)
I noticed that I couldn't log anything after the SerialConsole module
loaded. In it's on_module_loaded it does:
THEKERNEL->streams->append_stream(this);
but the StreamOutputPool wasn't called in the Kernel until much later. I
moved the stream initialization to before the SerialConsole and I'm now
getting G code responses! Yay!
[image: screenshot 2016-06-27 12 42 23]
https://cloud.githubusercontent.com/assets/565562/16393208/af1ec02a-3c64-11e6-91e4-65decbd40040.png
I'll send pull requests for the fixes once I take out my hacky debugging.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFQ5M7gSGufaumRiPQCMdVe_ZUHOMks5qQCfigaJpZM4I6WxX
.

Courage et bonne humeur.

@adamgreen
Copy link
Collaborator

@chrisbrent Excellent!

If you have working serial ports now, you could probably stop using one from within Smoothie and use it for the MRI debug monitor instead so that you could connect GDB for future debugging.

@arthurwolf
Copy link
Contributor

Wait what we have MRI on the M4 chips ?

On Mon, Jun 27, 2016 at 10:45 PM, Adam Green notifications@github.com
wrote:

@chrisbrent https://github.com/chrisbrent Excellent!

If you have working serial ports now, you could probably stop using one
from within Smoothie and use it for the MRI debug monitor instead so that
you could connect GDB for future debugging.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFbLYgH3NPmgfZ97o7jDRf9NhV_yOks5qQDZegaJpZM4I6WxX
.

Courage et bonne humeur.

@adamgreen
Copy link
Collaborator

adamgreen commented Jun 27, 2016

@arthurwolf Yeah, that is why I got the Bambino210E in the first place. So that I could port it to the LPC43xx. :)

Edit: I looked back at my MRI history and it was added in February 2015.

@arthurwolf
Copy link
Contributor

I didn't realize. I thought that was still a todo. Maybe the JTAG clouded
my vision. That's sooo cool.

On Mon, Jun 27, 2016 at 10:52 PM, Adam Green notifications@github.com
wrote:

@arthurwolf https://github.com/arthurwolf Yeah, that is why I got the
Bambino210E in the first place. So that I could port it to the LPC43xx. :)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#13 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAGpFUJJpSr7hjxo5sGZOl1c_Y-DyP37ks5qQDgEgaJpZM4I6WxX
.

Courage et bonne humeur.

@adamgreen
Copy link
Collaborator

@chrisbrent I have updated the makefile to allow the Smoothie firmware to startup and run on the Bambino boards as well. I used the changes from your commit to create the Bambino200E customizations and I tested the Bambino210E ones on my board. By default the makefile still builds a binary suitable for running on Smoothie2 boards but you can modify one line in the makefile to switch it to the Bambino200E. I documented the selection that you can select in the makefile here.

@adamgreen
Copy link
Collaborator

@chrisbrent Can we close this bug now? Does the combination of your PR and my PR resolve this issue?

@adamgreen
Copy link
Collaborator

Closing as @chrisbent has submitted PR #14 to fix the initial issues that he was hitting with the Bambino200E.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants