Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Help New Board : CZ Mini STM32F103

$
0
0

Help New Board : CZ Mini STM32F103

Drakelive

Posts: 21
Joined: Fri Jun 05, 2015 10:29 am
Location: Italy

Help New Board : CZ Mini STM32F103

Postby Drakelive » Mon Jun 08, 2015 11:21 am

Hi

I bought this card from aliexpress:

UT8_2CzXipaXXagOFbXY.jpg
UT8_2CzXipaXXagOFbXY.jpg (232.48 KiB) Viewed 1174 times

I would try to use it as a demo board.
I had problems to send the .bin file. How can I run the Flash?

I have tried using the USB present on the board, but maybe I need an external programmer?

thanks
Drk

User avatar

ahull

Posts: 692
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby ahull » Mon Jun 08, 2015 11:37 am

USB232 on the board looks to be connected to the Prolific Chip, so I imagine that is going to allow you to talk directly to the board. You will need to set BOOT0 and BOOT1 correctly. Alternatively, you can use an ST-Link V2 clone and the Jtag connector as per the pictures below (same pins, different board). The ST-Link V2 clones can be found on Ali Express and Ebay for a couple of dollars,

Image

Image

– Andy Hull –

victor_pv

Posts: 633
Joined: Mon Apr 27, 2015 12:12 pm

Re: Help New Board : CZ Mini STM32F103

Postby victor_pv » Mon Jun 08, 2015 12:34 pm

To continue on what Andy said, the USB-232 can be used to connect to USART1 in that board.

It you don’t have ST-Link, you can use that USB-232 port to upload bins to the board.

If you connect the jumper from boot0 to +3.3 and from boot1 to GND, the board will boot the STM ROM bootloader, which uses USART 1.
As that is connected to the USB-232 with the converter, you can now use a program in Windows to upload .bin files to the board.

The STM tool for that is called something like Bootloader Demonstrator. Search for it online, it’s on STM webpage somewhere. It is a Windows only tool as far as I know.

At that point, unless you need to use all the flash in the board (unlikely), I would upload the new bootloader that we have modified to work on generic boards. It’s in a repo in Roger’s github, and there is a link to it in the announcements forum section. (the repo is STM32duino-bootloader).

Your board seems to have 2 leds in PE2 and PE0, and Roger has compiled the bootloader for several different led ports, but I don’t see it for PE2 or PE0, so you will need to modify the source and compile it.
When I get to work I can try to download the source and modify it for you if you have problems doing that.

Once you upload the STM32duino bootloader, you can use the main port to upload sketches with the DFU bootloader, which is easier to use because it reboots the board automatically and goes in bootloader mode a few seconds on every reboot before jumping to the sketch, so you don’t need to be changing the boot0 jumper all the time.

victor_pv

Posts: 633
Joined: Mon Apr 27, 2015 12:12 pm

Re: Help New Board : CZ Mini STM32F103

Postby victor_pv » Mon Jun 08, 2015 3:15 pm

I just compiled the one attached here, give it a shot and let me know if it works.
I am at work right now so I dont have any board to test it out.
I set the led to port PE2, and the button to GPIOB11, which seems to be one of the buttons in the front of that board next to the USB connectors.
ATTACHMENTS
generic_boot20_pe2.zip
(4.89 KiB) Downloaded 43 times

Drakelive

Posts: 21
Joined: Fri Jun 05, 2015 10:29 am
Location: Italy

Re: Help New Board : CZ Mini STM32F103

Postby Drakelive » Mon Jun 08, 2015 3:40 pm

Hi Victor_pv

Tonight I control the LEDs on my card but the picture seems to me to read and PE0 PE2 and the electrical diagram provided by the Chinese seller confirms it but I want to spend a few minutes to check the accuracy.
For programming I have a USB-232 working at 3.3v but Thursday I should deliver an original ST-Link V2 bought on Ebay.
I work on Linux so I need software that run on it. I was able to program the ST Nucleo Boards in linux ( on Eclipse) by filling out a simple project in GitHub (https://github.com/texane/stlink) .
I see now that while I was writing this mail have already taken steps to compile the bootloader :-) Thanks.
I think I need to read something on the bootloader to understand how it works, how to it write and how to use it to load firmware.
As always, a step at a time

I keep you updated

Thanks
Drk

victor_pv

Posts: 633
Joined: Mon Apr 27, 2015 12:12 pm

Re: Help New Board : CZ Mini STM32F103

Postby victor_pv » Mon Jun 08, 2015 3:54 pm

This program is supposed to work with the serial bootloader in linux:
https://code.google.com/p/stm32flash/

I have not used it ever, so dont know if it works, but you can give it a shot and let us know.
Once you upload the bootloader to the board, it will work like the bootloader in the official Maple and Maple Mini boards, with the DFU protocol.

User avatar

ahull

Posts: 692
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby ahull » Mon Jun 08, 2015 7:08 pm

The existing ../hardware/Arduino_STM32/tools/linux/stlink_upload option should work too.

This is what is called by the following upload methods in linux.

CODE: SELECT ALL

nucleo_f103rb.upload.tool=stlink_upload
genericSTM32F103C.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
genericSTM32F103R.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
genericSTM32F103V.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
genericSTM32F103Z.menu.upload_method.STLinkMethod.upload.tool=stlink_upload

.. so in theory the ST-Link V2 gadget should just work if you select “genericSTM32F103Z” for the board type, and “Upload method: stlink” in the IDE and wire it as per my pictures above. If it doesn’t, give us a shout and we can go through it step by step. A number of us are using Linux, so I’m sure we can get it working.

– Andy Hull –

Drakelive

Posts: 21
Joined: Fri Jun 05, 2015 10:29 am
Location: Italy

Re: Help New Board : CZ Mini STM32F103

Postby Drakelive » Tue Jun 09, 2015 2:32 pm

Hi

I spent a bit of time to understand how it is made this card. I found this:

Led –> PE0, PE2
Button –> PB10, PB11

One of the two USB port is interfaced to Chip PL2303HX. There are also two transistor which was discussed on the forum.

BOOT1 ( PB2 )
RESET# ( NRST = pin25 )
PL2303_TXD —> USART1_RX ( PA10 )
PL2303_RXD <— USART1_TX ( PA9 )

Linux reads me ttyUSB0 and serial device when I connect the board to the computer.
The second USB port is connected to pins USB_DM ( PA11 ) and USB_DP ( PA12 )

Bootloader and Programmer

Since I have a programmer ST-Link v2 do not think I can be useful a bootloader, I can directly use the programmer using the JTAG connector.
If I understand it to be able to program the STM32 chip via external programmer I needed to connect the pin BOOT1 to Ground?
Can you confirm this?

The controller ST-Link v2 has two connectors: one JTAG and a 4-pin connector.
The JTAG is simple because the generic card STM32 I own has a dedicated JTAG connector, but for the 4 Pin how do I connect to the Board?

Drk

User avatar

Rick Kimball

Posts: 367
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby Rick Kimball » Tue Jun 09, 2015 2:46 pm

Drakelive wrote:The controller ST-Link v2 has two connectors: one JTAG and a 4-pin connector.
The JTAG is simple because the generic card STM32 I own has a dedicated JTAG connector, but for the 4 Pin how do I connect to the Board?

Check to see if the 4 pins are GND/SWDIO/SWCLK/VCC

The USB_DP, does that have a pull up resistor? Or is there a transistor circuit that lets you disconnect?

-rick

User avatar

ahull

Posts: 692
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby ahull » Tue Jun 09, 2015 10:21 pm

Drakelive wrote:
Since I have a programmer ST-Link v2 do not think I can be useful a bootloader, I can directly use the programmer using the JTAG connector.
If I understand it to be able to program the STM32 chip via external programmer I needed to connect the pin BOOT1 to Ground?
Can you confirm this?

Yes, I have Boot 0 and Boot 1 both tied to ground.

The controller ST-Link v2 has two connectors: one JTAG and a 4-pin connector.
The JTAG is simple because the generic card STM32 I own has a dedicated JTAG connector, but for the 4 Pin how do I connect to the Board?

Drk

What are the pin names on your “Jtag” and “4 pin” connectors?

Image
This might be a better picture of how I have things connected. I am only using 4 wires (SWDIO,GND,SWCLK and 3v3) as you can see from this picture and the previous ones.

– Andy Hull –

Help New Board : CZ Mini STM32F103

Drakelive

Posts: 21
Joined: Fri Jun 05, 2015 10:29 am
Location: Italy

Re: Help New Board : CZ Mini STM32F103

Postby Drakelive » Tue Jun 16, 2015 11:30 am

Hi

In the WE finally I put my hands on the controller ST-Link V2 delivered by the postman.
As a first test I used the classic Blik sckech. I only had to change the LED pin ( PE2 )
Board (CZ Mini STM32F103) and programmer, they were connected through the JTAG port.
BOOT0 and BOOT1 set on the ground.
I Compiled and binary Flashing directly from Arduino IDE.
Everything worked in the first test. No problems found. The skech works perfectly !!!!!
There was no need to change Jumper for BOOT0 and BOOT1.

As a first test I chose not to install the Bootloader

I’m really happy and super excited. Now I have to go deeper with the study.

Thank you all for your support.

Drk

User avatar

ahull

Posts: 692
Joined: Mon Apr 27, 2015 11:04 pm
Location: Sunny Scotland
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby ahull » Tue Jun 16, 2015 12:37 pm

Good to see it worked first time. :D
– Andy Hull –
User avatar

RogerClark

Posts: 2423
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Help New Board : CZ Mini STM32F103

Postby RogerClark » Tue Jul 07, 2015 3:56 am

@Drakelive

The Bootloader is worth installing, however I’ve not specifically compiled a version for a board with the LED on PE2
Annoyingly there is no standardisation for which LED these boards use.

I will try to create make file target / config for a generic board with LED on PE2

I’ve just created a bootloader version for that board (so it flashes the correct LED).

https://github.com/rogerclarkmelbourne/ … 20_pe2.bin

When you feel like installing the bootloader let me know how you get on.

BTW. On windows you need to install a driver (see driver/win/install.bat ) On Linux there is a script you need to run (install.sh)
On Mac no other installation should be required.
See https://www.youtube.com/watch?v=0jdJp3TQuJY

Note, If it doesnt look like the bootloader is working, I could have screwed up the config, as I don’t have a board to test it on (but I can have a go testing on another one of my boards by attaching an external LED)

Cheers

Roger



Viewing all articles
Browse latest Browse all 764

Trending Articles