Smoothieware / Smoothie2-old

(Deprecated attempt at) A Smoothie firmware port to the Smoothieboard v2 boards.
GNU General Public License v3.0
34 stars 22 forks source link

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

Closed chrisbrent closed 8 years ago

chrisbrent commented 8 years ago

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 commented 8 years ago

I would start by reading my comments on issue https://github.com/Smoothieware/Smoothie2/issues/12#issuecomment-223782031

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.

chrisbrent commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-227863087, or mute the thread https://github.com/notifications/unsubscribe/AAGpFW2x1ds3Yo0ojiRLoXKyctfnI6k8ks5qOZfRgaJpZM4I6WxX .

Courage et bonne humeur.

chrisbrent commented 8 years ago

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 commented 8 years ago

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

chrisbrent commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/12#issuecomment-223782031 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 commented 8 years ago

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) https://github.com/Smoothieware/Smoothie2/issues/12#issuecomment-223782031 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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228186684, or mute the thread https://github.com/notifications/unsubscribe/AAGpFZMA6myOzSoxGIhoW14VzVHJ96omks5qOvfrgaJpZM4I6WxX .

Courage et bonne humeur.

adamgreen commented 8 years ago

@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 commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228196157, or mute the thread https://github.com/notifications/unsubscribe/AAGpFfvJBk3a5ocrpbaQ24KFOH_Vgo2hks5qOwBGgaJpZM4I6WxX .

Courage et bonne humeur.

arthurwolf commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228196157, or mute the thread https://github.com/notifications/unsubscribe/AAGpFfvJBk3a5ocrpbaQ24KFOH_Vgo2hks5qOwBGgaJpZM4I6WxX .

Courage et bonne humeur.

Courage et bonne humeur.

adamgreen commented 8 years ago

@arthurwolf Thanks for the info

chrisbrent commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228197092, or mute the thread https://github.com/notifications/unsubscribe/AAihOms9qlUpevj4anMmlbMpkhv4FQ3Lks5qOwESgaJpZM4I6WxX .

chrisbrent commented 8 years ago

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

chrisbrent commented 8 years ago

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 commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228853278, or mute the thread https://github.com/notifications/unsubscribe/AAGpFQ5M7gSGufaumRiPQCMdVe_ZUHOMks5qQCfigaJpZM4I6WxX .

Courage et bonne humeur.

adamgreen commented 8 years ago

@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 commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228869800, or mute the thread https://github.com/notifications/unsubscribe/AAGpFbLYgH3NPmgfZ97o7jDRf9NhV_yOks5qQDZegaJpZM4I6WxX .

Courage et bonne humeur.

adamgreen commented 8 years ago

@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 commented 8 years ago

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 https://github.com/Smoothieware/Smoothie2/issues/13#issuecomment-228871670, or mute the thread https://github.com/notifications/unsubscribe/AAGpFUJJpSr7hjxo5sGZOl1c_Y-DyP37ks5qQDgEgaJpZM4I6WxX .

Courage et bonne humeur.

adamgreen commented 8 years ago

@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 commented 8 years ago

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

adamgreen commented 8 years ago

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