-1

I have an STM32F446 processor (Cortex M4 with FPU, havard architecture) and I planned to build a "mini computer" (screen, keyboard) with it.

Is it possible to programm assembler on the device itself and let it programm/flash itself with that code or execute that code without the help of external hardware? And if so how can it be done?

Thank you for your answers.

old_timer
  • 69,149
  • 8
  • 89
  • 168
Beny Benz
  • 13
  • 5
  • 1
    A true harvard architecture computer is more of an academic notion than anything useful in the real world. These are by no means harvard architecture, read the documentation please. "modified harvard" means von neumann with one or more busses with tags on the transactions. See the bus specs (read the documentation). As well as simply try it... – old_timer Mar 11 '18 at 04:08
  • This is obviously a duplicate of https://stackoverflow.com/questions/44443619/how-to-write-read-to-flash-on-stm32f4-cortex-m4 and should have remained closed as such. – Chris Stratton Mar 12 '18 at 02:50
  • 1
    @Chris Stratton I think it isn't a duplicate of the questions like "how to write to flash memory" because the thing I wanted to know is how do you get your written code on your flash to execute / if you need to pay special attention on how to write in order to execute that code later. Sorry if my question is formulated unclear. Do you have an idea how I could alter the question so this is clearer? – Beny Benz Mar 12 '18 at 13:28
  • That is exactly what the other question is about. But if my answer didn't address your question, you should not have accepted it, and should undo that now. Also, you are not supposed to edit answers into questions - that is not how stackoverflow works. – Chris Stratton Mar 12 '18 at 15:12

2 Answers2

2

Yes, it is possible.

First, realize that the ARM Cortex-M parts are not a true Harvard architecture, but rather a sort of Harvard-ish optimization implementing a Von Neumann programming model.

As for specially how you do it, the answer is that you read the applicable ST Application Note on writing to flash on that particular processor.

Along the way you'll probably learn that it ships with a ROM bootloader capable of writing to flash, and also that "externally" writing flash via SWD/JTAG typically in actual practice amounts to uploading a buffer of data to RAM along with a small stub of code to do the actual writing, and triggering that code to execute on the processor before returning control the the SWD/JTAG adapter.

Chris Stratton
  • 39,853
  • 6
  • 84
  • 117
  • Is this question still a duplicate, or should we reopen and just put a link to https://stackoverflow.com/questions/44443619/how-to-write-read-to-flash-on-stm32f4-cortex-m4 in your answer? – Peter Cordes Mar 12 '18 at 02:24
  • Practically speaking I think it's a duplicate, I just wanted to cover a possible meaning of that odd assembler line – Chris Stratton Mar 12 '18 at 02:31
  • If it's worth posting more than just a comment to explain why it's a duplicate, it should probably be reopened. What I've done in the past in cases like this is start my answer with "this is basically a duplicate of `[link]`, but blah blah". Answering and then closing it so nobody else can answer looks bad, even though in this case there's not really anything more to be said. Reopening the question now. – Peter Cordes Mar 12 '18 at 02:37
  • No, it's really not. You've just wasted everyone's time re-opening a low quality and obvious duplicate. If I'd found that link before I posted I never would have. At most what my expansions of the answer does is point out that it's also eligible for closure as "unclear what you are asking" – Chris Stratton Mar 12 '18 at 02:48
  • I thought you were saying there was part of this question that was worth answering (and still think that's at least barely true). Anyway, it's not like it was going to get auto-deleted by the roomba with an upvoted + accepted answer, so closing as duplicate wouldn't really reduce the pollution from this low-quality question. And if people are wondering about harvard-ness instead of realizing that they just need to write the flash memory, this is a useful answer for them. – Peter Cordes Mar 12 '18 at 02:57
0

Arms are not Harvard architecture at all. as they have a single address space. It does not matter if this address space and be reached by one or more busses.

Answering your question you can software program. the FLASH memery

0___________
  • 60,014
  • 4
  • 34
  • 74
  • NO! cortex M3, M4, M7 and M33 uses Harvard architecture. Harvard architecture is used to separate access to different memories although it uses same address space. – vlk Mar 14 '18 at 15:44
  • It is called "modified"Harvard architecture. Harvard architecture has to have the separate address spaces – 0___________ Mar 14 '18 at 17:02