Developing for STM324xG-EVAL board

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
xlh1460
Posts: 25
Joined: Wed May 22, 2013 6:48 pm

Developing for STM324xG-EVAL board

Postby xlh1460 » Mon Jun 24, 2013 6:38 pm

I found board support files for ST_STM3220G_EVAL but no demos.

I am actually developing for a STM3241G-EVAL board but the boards are very similar (the PCBs, themselves, are identical)

If anyone has any working ones that they can share, I would appreciate it.

If not, I guess I need to get to work :D


Thanks.

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Developing for STM324xG-EVAL board

Postby Tectu » Mon Jun 24, 2013 6:42 pm

I have no demos for you - however, you should be able to get demos from different boards working quite quickly since this is the meaning behind the board files.

I couldn't find out what TFT and touchscreen controller is used on that board - if you get those working, we'd be thankful for sharing your drivers and your board files :)


~ Tectu

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: Developing for STM324xG-EVAL board

Postby Giovanni » Mon Jun 24, 2013 6:48 pm

Hi,

Like Tectu explained you can start from any STM32F4 demo and swap the reference to the board in the Makefile (better start from a simple demo), then you need to fix the small differences such as LED names and port numbers in main.c.

Giovanni

xlh1460
Posts: 25
Joined: Wed May 22, 2013 6:48 pm

Re: Developing for STM324xG-EVAL board

Postby xlh1460 » Mon Jun 24, 2013 8:02 pm

I will definitely share anything I do including the support files for the display.

Incidentally, it uses the ILI9325 display chip and the STMPE811 for the touchscreen so I am hopeful that getting those working should be little trouble.

I copied the ST_STM3220G_EVAL directory to ST_STM3241G_EVAL and made the following changes to the board.h file:

Code: Select all

$ diff ST_STM3220G_EVAL/board.h ST_STM3241G_EVAL/board.h
27,28c27,28
< #define BOARD_ST_STM3220G_EVAL
< #define BOARD_NAME              "ST STM3220G-EVAL"
---
> #define BOARD_ST_STM3241G_EVAL
> #define BOARD_NAME              "ST STM3241G-EVAL"
37a38,43
>  * Board voltages.
>  * Required for performance limits calculation.
>  */
> #define STM32_VDD                   330
>
> /*
40c46
< #define STM32F2XX
---
> #define STM32F4XX


Note that I need to add the board voltage as it missing and caused the following compiler error:

Code: Select all

Compiling ext.c
In file included from ../../os/hal/include/hal.h:43:0,
                 from ../../os/hal/src/hal.c:37:
../../os/hal/platforms/STM32F4xx/hal_lld.h:924:2: error: #error "invalid VDD voltage specified"


Now I am getting the following errors related to my clock settings:

Code: Select all

13:00:05 **** Build of configuration Default for project ARMCM4-STM3241G-EVAL ****
make -j4 all
Compiling hal.c
Compiling adc.c
Compiling can.c
Compiling ext.c
In file included from ../../os/hal/include/hal.h:43:0,
                 from ../../os/hal/src/hal.c:37:
../../os/hal/platforms/STM32F4xx/hal_lld.h:1104:2: error: #error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1167:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1179:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1199:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1231:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1255:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1279:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1324:2: error: #error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
In file included from ../../os/hal/include/hal.h:43:0,
                 from ../../os/hal/src/can.c:37:
../../os/hal/platforms/STM32F4xx/hal_lld.h:1104:2: error: #error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
In file included from ../../os/hal/include/hal.h:43:0,
                 from ../../os/hal/src/adc.c:37:
../../os/hal/platforms/STM32F4xx/hal_lld.h:1104:2: error: #error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1167:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1167:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1179:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
In file included from ../../os/hal/include/hal.h:43:0,
                 from ../../os/hal/src/ext.c:37:
../../os/hal/platforms/STM32F4xx/hal_lld.h:1104:2: error: #error "STM32_PLLCLKIN outside acceptable range (STM32_PLLIN_MIN...STM32_PLLIN_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1199:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
In file included from ../../os/hal/include/adc.h:94:0,
                 from ../../os/hal/include/hal.h:55,
                 from ../../os/hal/src/hal.c:37:
../../os/hal/platforms/STM32F4xx/adc_lld.h:281:2: error: #error "STM32_ADCCLK outside acceptable range (STM32_ADCCLK_MIN...STM32_ADCCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1231:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1255:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1167:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1279:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1179:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
make: *** [build/obj/hal.o] Error 1
make: *** Waiting for unfinished jobs....
../../os/hal/platforms/STM32F4xx/hal_lld.h:1324:2: error: #error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1179:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1199:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1231:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1255:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1199:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1279:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1231:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1324:2: error: #error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
In file included from ../../os/hal/include/adc.h:94:0,
                 from ../../os/hal/include/hal.h:55,
                 from ../../os/hal/src/adc.c:37:
../../os/hal/platforms/STM32F4xx/adc_lld.h:281:2: error: #error "STM32_ADCCLK outside acceptable range (STM32_ADCCLK_MIN...STM32_ADCCLK_MAX)"
In file included from ../../os/hal/include/adc.h:94:0,
                 from ../../os/hal/include/hal.h:55,
                 from ../../os/hal/src/can.c:37:
../../os/hal/platforms/STM32F4xx/adc_lld.h:281:2: error: #error "STM32_ADCCLK outside acceptable range (STM32_ADCCLK_MIN...STM32_ADCCLK_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1255:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1279:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)"
../../os/hal/platforms/STM32F4xx/hal_lld.h:1324:2: error: #error "STM32_PLLI2SVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
In file included from ../../os/hal/include/adc.h:94:0,
                 from ../../os/hal/include/hal.h:55,
                 from ../../os/hal/src/ext.c:37:
../../os/hal/platforms/STM32F4xx/adc_lld.h:281:2: error: #error "STM32_ADCCLK outside acceptable range (STM32_ADCCLK_MIN...STM32_ADCCLK_MAX)"
make: *** [build/obj/adc.o] Error 1
make: *** [build/obj/can.o] Error 1
make: *** [build/obj/ext.o] Error 1

13:00:08 Build Finished (took 3s.135ms)



The board file has the clocks defined (correctly, I believe) as:

#define STM32_LSECLK 32768
#define STM32_HSECLK 25000000

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: Developing for STM324xG-EVAL board

Postby Giovanni » Mon Jun 24, 2013 8:17 pm

Your board mounts a different crystal from the original one, you need to setup the clock-related parameters in mcuconf.h in order to have the PLL working in the correct range, this may require some study of the reference manual.

Giovanni

xlh1460
Posts: 25
Joined: Wed May 22, 2013 6:48 pm

Re: Developing for STM324xG-EVAL board

Postby xlh1460 » Mon Jun 24, 2013 9:04 pm

I see, I think.

My board has a 25MHz crystal but the mcuconf.h file in my project is one that I "borrowed" from the STM32F4-DISCOVERY demo.

That board has an 8MHz crystal which is why the settings need to be adjusted.

Is that about it?

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: Developing for STM324xG-EVAL board

Postby Giovanni » Mon Jun 24, 2013 9:16 pm

Correct. you have to operate on:
1) input divider STM32_PLLM_VALUE
2) multiplier STM32_PLLN_VALUE
3) output divider STM32_PLLP_VALUE

Look at figure 13 on the Reference Manual in order to understand all the parameters in mcuconf.h. I think you just need to put "M" at 25 and drive the PLL at 1MHz like the other demos do.

Giovanni

xlh1460
Posts: 25
Joined: Wed May 22, 2013 6:48 pm

Re: Developing for STM324xG-EVAL board

Postby xlh1460 » Mon Jun 24, 2013 9:45 pm

You are absolutely right, I just changed the STM32_PLLM_VALUE value to 25 and it compiles fine.

I actually cheated and looked at the mcuconf.h file for an Olimex board with a 25MHz crystal.

I'll have a look at the reference manual too, though since this is pretty important stuff. :)

I am going to take a look now at porting some of the demos that come with the STM32F4 StdPeriph Library.

Thanks again for your support.

xlh1460
Posts: 25
Joined: Wed May 22, 2013 6:48 pm

Re: Developing for STM324xG-EVAL board

Postby xlh1460 » Tue Jun 25, 2013 4:31 am

I have a very simple demo running on my board now which I have attached.

This exercises the 4 LEDs and the 3 pushbuttons available on the board.
Attachments
ARMCM4-STGM3241-EVAL-demo1.zip
(15.14 KiB) Downloaded 183 times

User avatar
Giovanni
Site Admin
Posts: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

Re: Developing for STM324xG-EVAL board

Postby Giovanni » Tue Jun 25, 2013 8:29 am

Good job :)

Moving the thread to the contributions forum.

Giovanni


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 3 guests