mikroC ARM V3.0 and ST Standard Peripherals Library

General discussion on mikroC PRO for ARM.
Author
Message
User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#16 Post by marina.petrovic » 04 Oct 2013 15:19

Hi,

Please, try the "STM Test" example from attachment.
The example is adjust to work with the Standard Peripheral Library version 1.1.0.

Best regards,
Marina
Attachments
STM Test.zip
(743.67 KiB) Downloaded 323 times

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#17 Post by andrea_sea » 08 Oct 2013 16:35

Hi,
I followed the procedures of example test (STM Test.zip) and I tried to do the same thing with a new project on STM32L152 (Discovery board).
1) replaced the stdint.h file
2) set data type other (int 4 byte)
3) added into project, through project manager, desired STM peripheral library sources and header files
4) modified core_cm3.h and core_cmInstr.h files

Note: the main.c file is empty (I try to build only the library files)
ST library version
******************************************************************************
* @file misc.h
* @author MCD Application Team
* @version V1.1.1
* @date 05-March-2012
******************************************************************************
I can't attach the .zip file of the project because it's more than 256Kb (about 880 Kb)...

Unfortunately, many errors appear:

0 122 Compilation Started Test_STM32L_mio_01.c
3 123 Compiled Successfully Test_STM32L_mio_01.c
0 122 Compilation Started stm32l1xx.h
597 1503 Result is not defined in function: '__REV' core_cminstr.h
122 324 Undeclared identifier 'assert_param' in expression misc.c
122 317 Operator '' is not applicable to these operands '' misc.c
122 402 ; expected, but ')' found misc.c
122 424 '}' expected ';' found misc.c
142 324 Undeclared identifier 'assert_param' in expression misc.c
142 317 Operator '' is not applicable to these operands '' misc.c
142 402 ; expected, but ')' found misc.c
142 424 '}' expected ';' found misc.c
139 1163 Variable 'tmppriority' has been declared, but not used misc.c
139 1163 Variable 'tmppre' has been declared, but not used misc.c
139 1163 Variable 'tmpsub' has been declared, but not used misc.c
163 371 Specifier needed misc.c
163 396 Invalid declarator expected'(' or identifier misc.c
166 371 Specifier needed misc.c
166 300 Syntax Error: ')' expected, but '*' found misc.c
166 371 Specifier needed misc.c
166 300 Syntax Error: ')' expected, but '0xE000E000UL' found misc.c
166 402 ; expected, but '+' found misc.c
166 312 Internal error '' misc.c
0 122 Compilation Started stm32l1xx.h
597 1503 Result is not defined in function: '__REV' core_cminstr.h
193 324 Undeclared identifier 'assert_param' in expression stm32l1xx_adc.c
193 317 Operator '' is not applicable to these operands '' stm32l1xx_adc.c
193 317 Operator '' is not applicable to these operands '' stm32l1xx_adc.c
193 402 ; expected, but ')' found stm32l1xx_adc.c
193 424 '}' expected ';' found stm32l1xx_adc.c
202 371 Specifier needed stm32l1xx_adc.c
202 396 Invalid declarator expected'(' or identifier stm32l1xx_adc.c
223 324 Undeclared identifier 'assert_param' in expression stm32l1xx_adc.c
223 317 Operator '' is not applicable to these operands '' stm32l1xx_adc.c
223 317 Operator '' is not applicable to these operands '' stm32l1xx_adc.c
223 402 ; expected, but ')' found stm32l1xx_adc.c
223 424 '}' expected ';' found stm32l1xx_adc.c
219 1163 Variable 'tmpreg1' has been declared, but not used stm32l1xx_adc.c
220 1163 Variable 'tmpreg2' has been declared, but not used stm32l1xx_adc.c
270 1503 Result is not defined in function: '' stm32l1xx_adc.c
270 312 Internal error '' stm32l1xx_adc.c
1 122 Compilation Started stm32l1xx_adc.c
597 1503 Result is not defined in function: '__REV' core_cminstr.h
140 324 Undeclared identifier 'assert_param' in expression stm32l1xx_aes.c
140 317 Operator '' is not applicable to these operands '' stm32l1xx_aes.c
140 402 ; expected, but ')' found stm32l1xx_aes.c
140 424 '}' expected ';' found stm32l1xx_aes.c
202 324 Undeclared identifier 'assert_param' in expression stm32l1xx_aes.c
202 317 Operator '' is not applicable to these operands '' stm32l1xx_aes.c
202 402 ; expected, but ')' found stm32l1xx_aes.c
202 424 '}' expected ';' found stm32l1xx_aes.c
209 371 Specifier needed stm32l1xx_aes.c
209 396 Invalid declarator expected'(' or identifier stm32l1xx_aes.c
212 371 Specifier needed stm32l1xx_aes.c
... etc etc etc ...
0 102 Finished (with errors): 08 ott 2013, 17:15:07 Test_STM32L_mio_01.mcpar

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#18 Post by marina.petrovic » 09 Oct 2013 12:34

Hi,

Did you check Case sensitive checkbox in Tools -> Options -> Output Settings?

Best regards,
Marina

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#19 Post by andrea_sea » 09 Oct 2013 12:52

Sorry, I forgot the fifth point:
5) check Case sensitive checkbox in Tools -> Options -> Output Settings

Yes, I did.

Here there is the project zip file
https://docs.google.com/file/d/0B4rAq6t ... sp=sharing


Thank you and best regards.
Andrea

Brett_S
Posts: 16
Joined: 01 Jul 2012 05:50

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#20 Post by Brett_S » 09 Oct 2013 13:28

Thanks Marina,

The new STM Test project does the trick

Regards

Brett

catacluj
Posts: 3
Joined: 10 Oct 2013 00:26

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#21 Post by catacluj » 10 Oct 2013 00:29

Thank you for this sample project that compiled fine on my system.
BUT: things like "GPIO_InitTypeDef GPIO_InitStructure;" appear underlined in red and "Find Declaration" doesn't find anything.
How can I fix that, please?

Thanks,

Cat

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#22 Post by andrea_sea » 10 Oct 2013 10:03

Hello MArina,
something has changed after I copied the defines.pld file from STM Test to my project directory.
The compiler generates less error messages.

(Warning) 595 1503 Result is not defined in function: '__REV' core_cminstr.h

410 396 Invalid declarator expected'(' or identifier stm32l1xx_dac.c
413 424 '}' expected ';' found stm32l1xx_dac.c
422 371 Specifier needed stm32l1xx_dac.c
422 396 Invalid declarator expected'(' or identifier stm32l1xx_dac.c
424 324 Undeclared identifier 'Data2' in expression stm32l1xx_dac.c
424 324 Undeclared identifier 'Data1' in expression stm32l1xx_dac.c

60 393 'FLASH_BUSY' Identifier redefined stm32l1xx_flash.h
60 393 'FLASH_ERROR_WRP' Identifier redefined stm32l1xx_flash.h
60 393 'FLASH_COMPLETE' Identifier redefined stm32l1xx_flash.h
60 393 'FLASH_TIMEOUT' Identifier redefined stm32l1xx_flash.h
443 402 ; expected, but 'FLASH_RUNPowerDownCmd' found stm32l1xx_flash.h
444 402 ; expected, but 'FLASH_EraseParallelPage' found stm32l1xx_flash.h
444 393 '__RAM_FUNC' Identifier redefined stm32l1xx_flash.h
445 402 ; expected, but 'FLASH_ProgramHalfPage' found stm32l1xx_flash.h
445 393 '__RAM_FUNC' Identifier redefined stm32l1xx_flash.h
446 402 ; expected, but 'FLASH_ProgramParallelHalfPage' found stm32l1xx_flash.h
446 393 '__RAM_FUNC' Identifier redefined stm32l1xx_flash.h
446 312 Internal error '' stm32l1xx_flash.h

also similar errors for stm32l1xx_lcd.c and stm32l1xx_tim.c

This's the project folder:
https://docs.google.com/file/d/0B4rAq6t ... sp=sharing

Best regards.
Andrea

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#23 Post by marina.petrovic » 10 Oct 2013 14:03

Hi,

Please, can you try the example from attachment?

There are some adjustment.
In ...\Prova_lib_1\CMSIS\Device\ST\STM32L1xx\Include\stm32l1xx.h added:

Code: Select all

#define __RAM_FUNC FLASH_Status
In defines.pld added:

Code: Select all

data=__data
Best regards,
Marina
Attachments
Prova_lib_1.rar
(574.92 KiB) Downloaded 206 times

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#24 Post by andrea_sea » 10 Oct 2013 14:45

Dear Marina,
thanks for your kind support.

I tried to compile the project but but unfortunately there are still errors.
Attached the report file (.doc) with error messages displayed in red.

Regards
Andrea
Attachments
Report for Marina.zip
(5.13 KiB) Downloaded 198 times

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#25 Post by marina.petrovic » 11 Oct 2013 12:59

Hi,

I am very sorry for the inconvenience.
Problem occurs because all libraries in Library Manager was checked.

Please, try the project from attachment and un-check the unnecessary library in Library Manager.

Best regards,
Marina
Attachments
Prova_lib_1.rar
(574.51 KiB) Downloaded 257 times

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#26 Post by andrea_sea » 11 Oct 2013 15:17

Thank you very much Marina, all errors are gone :D :D :D

I also removed the USB library that caused some other error.
Forgive my ignorance but why I have to un-check only some libraries?
Are they in conflict with those contained in STM32L1xx_StdPeriph_Driver\src directory (for example USB) ?

What is the difference between Prova_lib_1.rar (10-10-2013) version and Prova_lib_1.rar (11-10-2013)?
I tried to un-check all the librarie in Library Manager form 10-10-2013 version but errors remain ...

Again many thanks.
Best regards.
Andrea

catacluj
Posts: 3
Joined: 10 Oct 2013 00:26

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#27 Post by catacluj » 11 Oct 2013 16:51

No help about this? It's about the sample you made for the STM32F4 Discovery board.
catacluj wrote:Thank you for this sample project that compiled fine on my system.
BUT: things like "GPIO_InitTypeDef GPIO_InitStructure;" appear underlined in red and "Find Declaration" doesn't find anything.
How can I fix that, please?

Thanks,

Cat

User avatar
marina.petrovic
Posts: 2986
Joined: 18 Apr 2013 08:11

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#28 Post by marina.petrovic » 14 Oct 2013 14:27

Hi,

The only difference between the two version of project that I attached is, somehow in first project,
almost all library remained included in Library manager.

Like you already notice, some of our libraries are in "conflict" with ST Standard Peripherals Library.
For example, in our Flash Memory Library we use constant with the same name like one in ST Standard Peripherals Library.

As regarding, "Find Declaration" problem, I managed to reproduce the same behavior.
I will pass that problem to our software developers and they will try to correct it as soon as possible.

Thank you, catacluj, for pointing out that behavior and sorry for the inconvenience.

Best regards,
Marina

andrea_sea
Posts: 20
Joined: 01 Oct 2012 15:34

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#29 Post by andrea_sea » 14 Oct 2013 15:24

Ok Marina, thank you very much.
Best regards.

Andrea

sshahryiar
Posts: 5
Joined: 20 Jul 2010 04:59

Re: mikroC ARM V3.0 and ST Standard Peripherals Library

#30 Post by sshahryiar » 24 May 2014 17:55

Can somebody help with STM32F2xx standard peripheral library with MikroC? I did as in the posts above for the STM32F10x series and it worked well but I can't do the same for STM32F2xx series.

Post Reply

Return to “mikroC PRO for ARM General”