Main Site Documentation

Porting NETMF 4.4 to an STM32F4


#162

@Brett It is probably the flash / ram mapping…I wasn’t sure what to change converting from an STM32F411Nucleo to an STM32F401. All I changed was the size but am not sure if base address is different or any other settings…it was pretty overwhelming the first attempt lol.


#163

You are going to learn by doin’ it … :slight_smile:


#164

The scatter files are all wrong


#165

@Justin Which part/how do I fix it? I changed the flash size from 128 kb to 96 kb like the datasheet lists but was unsure what else needs changing


#166

As i said the scatter files are all wrong - you need to change a half dozen lines or so in both tinybooter and tinyclr scatter files as you only have 96kb ram not 128km

And once you do that…

Tada…
G30 processor running NETMF 4.4 in VS2017


#167

I don’t understand what lines need changing other than line 20 in both scatterfiles, that is the only instance of 128 kb I can find. Can you give an example line that still refers to the 128 kb please?


#168
<Set Name="Heap_BaseAddress"        Value="0x20008000"/>
<Set Name="Heap_Size"               Value="0x00017000"/><!-- 92K -->

<Set Name="Stack_Bottom"            Value="0x2001DE00"/>
<Set Name="Stack_Top"               Value="0x2001FDF8"/>

<Set Name="CustomHeap_Begin"        Value="0x2001FE00"/>
<Set Name="CustomHeap_End"          Value="0x2001FFF8"/>

#169

So your Heap, stack and Custom heap are sitting in a region lager than 96kb

ie 1FFF8 == 130,048 in decimal which == 127 which last time i looked is > than 96 :wink:


#170
  1. Why is it calculated by 111F8 and not 2001FFF8?

  2. Do the heap, stack, and custom heap all have to add up to less than 96? Or are they supposed to be 96 kb each?

  3. If the custom heap begins at 1FE00 (130,560) and ends at 1FF8 (130,048), why isn’t the size of the region 130,560 - 130,048 = 512 / 1024?


#171
  1. Because you dont have 512MB of ram… :rofl:
    0x20000000 is the base address and you have 18000 which is 96kb ram

  2. if you only have 96kb of ram then yes every thing has to fit in the 96kb ram

  3. There is your problem - those settings are for a 128kb STM32F411 - you have to fit it all inside the lower 96kb


#172
  1. Where is the base of 0x20000000 coming from? I understand I have 0x00018000 kb of ram…that’s about as much as I understand so far lol

  2. Should I make the heap, stack, and customheap equal sizes of 32 kB (to maintain a total < 96) or does one region need to be larger than the others?

  3. I have no idea how to define the appropriate region “boundaries,” to correspond to my 96 kB of ram. What is the size of CustomHeap as it is now? 1FFF8 == 130,048 in decimal which == 127 kb, do you subtract the start address from this at all? Is the customHeap region 127 kb total or is it == (127 kb - customHeap_Begin)

…I think I am stuck on how the base addresses and starting addresses tie into the end address.


#173
  1. Line 19

  2. Nope - look at the 411 and follow it - ie make the Heap smaller and move them all into 96kb

  3. Look closer at the start and end address for the 411 - Custom Heap is only 1F8 in size == 504 decimal


#174

i tried to make and calculator

please can you check did i make well or have something (forgot)

download file here
https://drive.google.com/file/d/1swoFdGPqlcK_txPK7SCE8lRIqu8szFGu/view?usp=sharing

@Justin please can you advise us more about

i tried to make an calculator in EXCEL to automate heaps calculation for scatter files


#175
Custom heap doesn't really need in G30, instead of that, it is used to load interrupt vector.  Check those values below if they look ok to you.

    <Set Name="Code_SRAMBaseAddress" Value="0x20000000" />
	<Set Name="Code_SRAMSize"        Value="0x00004000" />

        <Set Name="Stack_Bottom" Value="0x20004000" />
	<Set Name="Stack_Top"    Value="0x20006DF8" />

	<Set Name="Custom_Heap_Begin" Value="0x20006E00" />
	<Set Name="Custom_Heap_End"   Value="0x20006FF8" />

	<Set Name="Heap_Begin" Value="0x20007000" />
	<Set Name="Heap_End"   Value="0x20017FF8" />

#176

@valon_hoti_gmail_com @dweaver Ok I got the Framework on and it shows up in device manager and MFDeploy now. What library / reference do I find the pins like PC0, PA1, etc in to replace GHI.Pins?


#177

try this class / library

(you can modify it for your needs)


#178

This should work: https://old.ghielectronics.com/downloads/man/G30_Datasheet.pdf


#179

Also what version of Visual Studio should I be using now? I wrote all my programs in 2013, it says they are incompatible with 2015

I don’t see a device in VS2013


#180

Netframework 4.4 is compatible with vs2015 and vs2017 with @Justin released vsix file

Netframework 4.3 is compatible with vs2013


#181

I don’t see .NETMF as project type when trying to create a new project. I have the 4.4 SDK installed