Getting started - Partial success - what next?

STM32F103 Nucleo boards e.g. STM Nucleo F103RB
madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Getting started - Partial success - what next?

Post by madias » Thu May 28, 2015 6:50 pm

Dear Roger!
I had a little time to try out the new serial variant.
At first: Congrats, you nearly did it! :)

Please change in the nucleo boards.cpp the new lines to:

Code: Select all

#ifdef SERIAL_USB
	DEFINE_HWSERIAL(Serial1, 1);
	DEFINE_HWSERIAL(Serial2, 2);
	DEFINE_HWSERIAL(Serial3, 3);
#else
	DEFINE_HWSERIAL(Serial, 3);// Use HW Serial 2 as "Serial"
	DEFINE_HWSERIAL(Serial1, 2);
	DEFINE_HWSERIAL(Serial2, 1);
#endif
So the order is correct as on my pinsheet! (There was a little mismatch in your code , so "USB" serial was still Serial2)

As I promised, I also tested the maple mini with the new code, so I inserted the same #includes and #ifdefs into the maple mini boards.cpp. As expected all serials are working and are in the right order!

So I give my "OK" to the changes.

Thank you
Matthias

User avatar
RogerClark
Posts: 6681
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started - Partial success - what next?

Post by RogerClark » Thu May 28, 2015 9:51 pm

Hi Matthias

I tested on my F103c8 board, so I expected the maple mini would work;-)

I will use the definitions you have posted, and upload to the repo later.

Can i remove the serial USB section ? Is it possible to use serial USB on the Nucleo, I don't even know if it has a USB directly connected to the main processor ?

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Getting started - Partial success - what next?

Post by madias » Thu May 28, 2015 10:17 pm

Yes, it should be safe (I have done only compiling deleting it, not "real" tested, but this wouldn't be necessary )
You are right, there is no physically USB connection on any nucleo board.
Keep in mind, that for every "new" nucleo board (F4xxx) this modification is useful and must be set!

regards
Matthias

User avatar
RogerClark
Posts: 6681
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started - Partial success - what next?

Post by RogerClark » Thu May 28, 2015 10:57 pm

Matthias

OK about new Nucleo boards.

The structure of the F4 code is a lot different from the F1 code, so I'm not sure the same thing could be applied. I'd need to look.

I think fairly soon, I will need to devote a few days to update / merge the F4 and the F1 code, but its not an easy job ;-(

User avatar
sheepdoll
Posts: 234
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: Getting started - Partial success - what next?

Post by sheepdoll » Fri May 29, 2015 12:44 am

As far as I can tell I installed the serial test branch


Connecting wires from PA2/PA3 to the STLink TX/RX and running Madias's seral tests sketch from above I got "Port: Serial0" in the monitor window.

Attempting to upload a change in the sketch called the Maple booloader rather than the STM link. Disconnecting the line from PA2/PA2 and the modified sketch uploaded. Bit confusing as in software the ports names are zero based, but in STM cube they are unity based from 1. I also got a bit confused as USB is on USART1. It looks like when PA2/PA3 is connected to the STLink the VCP sees the target device as a raw chip

Switching to PC10/PC11 gives "Port: Serial2" as expected. Uploads work when connected to PC10/PC11 connecting just the line to D8 (PA9) gives "Port: Serial1"



Anyway good work, and reward yourself for time well spent. This F103 board is actually useful now.

User avatar
RogerClark
Posts: 6681
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started - Partial success - what next?

Post by RogerClark » Fri May 29, 2015 3:21 am

@sheepdoll

@madias sent me an updated file for the mapping, so I will use his, as he is the expert

I've not had chance to do the update yet as I've had some other urgent things to do this morning

I'll probably update it later

madias
Posts: 813
Joined: Mon Apr 27, 2015 11:26 am
Location: Vienna, Austria

Re: Getting started - Partial success - what next?

Post by madias » Fri May 29, 2015 6:54 am

@sheepdoll: This was the little change I provided to Roger, meanwhile you can edit in the /variant/nucleo_103rb/board.cpp the very last lines to

Code: Select all

#else
	DEFINE_HWSERIAL(Serial, 3);// Use HW Serial 2 as "Serial"
	DEFINE_HWSERIAL(Serial1, 2);
	DEFINE_HWSERIAL(Serial2, 1);
#endif
this would be the final change for getting Serial 100% working for nucleo!

User avatar
RogerClark
Posts: 6681
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Getting started - Partial success - what next?

Post by RogerClark » Fri May 29, 2015 7:27 am

Matthias

I will try to update this later, or definitely by the weekend.

But I've not had time to do it today,

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest