jserv / mini-arm-os

Build a minimal multi-tasking OS kernel for ARM from scratch
Other
1.06k stars 243 forks source link

port to stm32p103 platform #2

Closed rampant1018 closed 9 years ago

rampant1018 commented 9 years ago

@jserv, I'm not sure what is your course design so I just rewrite HelloWorld on stm32p103. If this kind of modification is ok I will port other project later.

jserv commented 9 years ago

@rampant1018 Great contribution. However, I wish that students can learn to look up from datasheet rather than invoking the routines implemented in the standard peripheral library at the early stage. In other words, no library should be used in the simple system programs like "Hello World".

rampant1018 commented 9 years ago

So can I use the startup code from the library? Or only the peripheral library should not be used.

jserv commented 9 years ago

@rampant1018 Good point. I am afraid that we can not minimize the length of the necessary low-level lines, at least for STM32. Comparing to ARM versatileab, it requires more code implemented for STM32 though at my first sight. Any idea?

rampant1018 commented 9 years ago

If we write the start-up code all in C code there will be no low-level codes. Maybe it will help students learning the flow of board start-up. I'm thinking that we just skip start-up section. Talk about configurations of RCC, GPIO and USART in HelloWorld, then look ahead to start-up code. Isn't it more interesting? Details always behind HelloWorld. =)

jserv commented 9 years ago

@rampant1018: As far as I know, one of the software development plan of ARM is to write most firmware in C rather than the mixture of assembly and C. I like your idea to prepare the low-level parts in C from "Hello World". ARM Cortex-M is capable to be the platform where we can experiment and introspect the documentations such as STM32F429I Discovery development.

@enginechang : Can you help?

rampant1018 commented 9 years ago

@jserv: There is no need to initialize rcc clock, copy data segment and zero bss section when we only need to print "HelloWorld"(I just validated it). So if you want the minimum startup code in HelloWorld project. The only thing have to do is put the entry point in the isr_vector.

jserv commented 9 years ago

@rampant1018: It sounds good since students can learn how a simple C program works along with inline assembly.

rampant1018 commented 9 years ago

I have done the work of minimization. Besides that I wrote a complete startup code for further use.

opass commented 9 years ago

@jserv: I will try to finish the teaching material STM32F429I Discovery development.