Starting to play with my STM32F105

Anything not related to STM32
Post Reply
dwight
Posts: 9
Joined: Sat Jul 22, 2017 1:46 am

Starting to play with my STM32F105

Post by dwight » Mon Dec 18, 2017 4:57 am

Hi All
I'm busy converting a eForth to run on a STM32F105. The eForth boot code was written for the STM32F307. I've converted to code as best I can but it still seems to not get the USART1 started. Many of the registers are in different locations and some of the bits are moved around. So far I know I've got something wrong since I don't even see a flash from the LED of the serial board I've got connected. I know the path it working because I'm able to load and read back code that I've downloaded. I'm not doing anything fancy with the clocks and should be running on the HSI clock at about 8MHz. Even if the baud rate was different, I should, still, see the output flicker when I boot and send a letter A.
I'd appreciate any help or if someone could even generate a HEX file of the init and sending a single character, it would be great. I realize that most of you just use a library but I have the need to be minimal for this part of the code. For this part of the code, the STM32F105 and STM32F103 should be the same.
Dwight

Code: Select all

Reset_Handler	
	BL	InitDevices	 	; RCC, USART1


InitDevices
; init Reset Clock Control RCC registers
	ldr	r0, =RCC 		; RCC
	ldr	r1, [r0, #0x18]	; RCC_AHB2ENR
	mov r7, #0x401c
	orr	r1, r7
	str	r1, [r0, #0x18]
; init USART1
	ldr	r0, =USART1 	; USART1
	movw	r1, #0x0340C	; enable USART TE RE EVEN PARITY LIKE BOOT
	strh	r1, [r0, #12]	; +12 USART_CR1 
	movw	r1, #143		; 8MHz/56000 (143, 0x8B) == 56000 FOR F105
	strh	r1, [r0, #8]	;  +8 USART_BR
; lets see if it sends anything 
        movw    r1, #0x41	; letter A 
	strh  	r1, [r0, #4 ]	; data register
	bx	lr



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

Re: Starting to play with my STM32F105

Post by RogerClark » Mon Dec 18, 2017 6:57 am

Hi Dwight

I'm not sure if this is the right forum for you.

Its a forum for Arduino on the STM32 series of boards

It doesn't look like you are programming using the Arduino API or IDE.

Its interesting that you are trying to run Forth on these processors, but STM have their own "community" forums, which may be more suitable for your project.
Or potentially a forum dedicated for the Forth language

dwight
Posts: 9
Joined: Sat Jul 22, 2017 1:46 am

Re: Starting to play with my STM32F105

Post by dwight » Mon Dec 18, 2017 2:06 pm

Hi Roger
There isn't much about Forth that would be an issue for me. It is a hardware problem. I'm not setting up something right.
I'm not using an IDE but I don't see that as an issue.
Maybe someone could just read back the registers from one of their F103 boards.
I guess I can put together a hello world program and run it through the Arduino IDE
to see what I missed.
Dwight

dwight
Posts: 9
Joined: Sat Jul 22, 2017 1:46 am

Re: Starting to play with my STM32F105

Post by dwight » Mon Dec 18, 2017 2:40 pm

I think I may have found my problem. I wasn't setting up the pins on port A. I need to configure them.
Dwight

dwight
Posts: 9
Joined: Sat Jul 22, 2017 1:46 am

Re: SOLVED Starting to play with my STM32F105

Post by dwight » Mon Dec 18, 2017 3:43 pm

Yes, that was my problem. Sorry for the extra noise.
Dwight

Post Reply