cancel
Showing results for 
Search instead for 
Did you mean: 

C skeleton for stm32F10xx series?

rael
Associate II
Posted on May 09, 2009 at 03:58

C skeleton for stm32F10xx series?

16 REPLIES 16
relaxe
Associate II
Posted on May 17, 2011 at 13:11

For a hitachi-style LCD, look at the STM32-SK/IAR:

http://iar.com/website1/1.0.1.0/658/1/?item=prod_prod-s1/225&group=prod_prod_grp-s1/33

IAR-EWARM has an example to drive the LCD. You can download the eval version to copy the example.

Else, olimex has a STM32 board with code for a graphical B&W LCD.

Else, The STM3210B and STM3210E both has graphical color LCD.

rael
Associate II
Posted on May 17, 2011 at 13:11

Thanks relaxe 8-)

relaxe
Associate II
Posted on May 17, 2011 at 13:11

You should copy paste a longer section of code. This line looks good. Could you have missed a ';' one or two lines up from there?

rael
Associate II
Posted on May 17, 2011 at 13:11

A question,

I'm getting an error: ''expected ')' before '*' token'',

and the line reads:

void assert_failed(uint8_t* file, uint32_t line);

From brouing similiar problems on the web, I get the idea that something is wrong with the uint8_t parameter, but I don't know the resolution.

Can anybody explain please ?

Thanks, Graham.

rael
Associate II
Posted on May 17, 2011 at 13:11

This is the code:

#ifdef USE_FULL_ASSERT

/**

* @brief The assert_param macro is used for function's parameters check.

* @param expr: If expr is false, it calls assert_failed function

* which reports the name of the source file and the source

* line number of the call that failed.

* If expr is true, it returns no value.

* @retval : None

**/

#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))

/* Exported functions ------------------------------------------------------- */

void assert_failed(uint8_t* file, uint32_t line);

#else

#define assert_param(expr) ((void)0)

#endif /* USE_FULL_ASSERT */

#endif /* __STM32F10x_CONF_H */

It's not even my code !

The RIDE compiler identifies syntax errors etc by file an line, double clicking takes you to the file, but not directly to the line.

I think I might be stumbling into a compiler specific issue, the raisonance STMCircle file uses this:

#ifdef DEBUG

/*******************************************************************************

* Function Name : assert_failed

* Description : Reports the name of the source file and the source line number

* where the assert error has occurred.

* Input : - file: pointer to the source file name

* - line: assert error line source number

* Output : None

* Return : None

*******************************************************************************/

void assert_failed(u8* file, u32 line)

{

/* User can add his own implementation to report the file name and line number,

ex: printf(''Wrong parameters value: file %s on line %d\r\n'', file, line) */

/* Infinite loop */

while (1)

{

}

}

#endif

and compiles without errors.

Any ideas ? :o

I was hoping to start with the most up to date environment.

rael
Associate II
Posted on May 17, 2011 at 13:11

I'm happier now...

I have my Piezo, an LED and some darlington transistor outputs toggling.

Some of my issues were related to my include files being partially sourced from my new directory, but my project tree being inconsistent with where the include files were being referenced from.

So... I was looking for a port invocation that was set the way I expected and needed to change, but in the wrong directory, where that invocation had actually been made. :|

Progress will be a lot faster now ! :)

Thanks for the ideas guys !

rael
Associate II
Posted on May 17, 2011 at 13:11

It looks like the STM pheripherals library version 3.0 is different than from the Raisonance ones.

I'll go with the latter for now :-?

It's still throwing up errors when I enable some of the pheripheral libraries, so I think I WILL start with a demo project, but I will also modify it heavily before sending it to my board.

(after I figure out how to compile to a .hex file for the RS232 serial boot loader!)