Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch.embedded > #25302

Re: How do I get rid of a memory hole(in cortexm0plus)?

From David Brown <david.brown@hesbynett.no>
Newsgroups comp.arch.embedded
Subject Re: How do I get rid of a memory hole(in cortexm0plus)?
Date 2016-10-31 10:24 +0100
Organization A noiseless patient Spider
Message-ID <nv72j0$cog$1@dont-email.me> (permalink)
References <nv4b16$j9n$1@gioia.aioe.org> <87b467f0-170c-4289-9c92-e250b57c562a@googlegroups.com>

Show all headers | View raw


On 31/10/16 09:16, Jack wrote:
> Il giorno domenica 30 ottobre 2016 09:29:30 UTC+1, Johann Klammer ha scritto:
>> I have been playing with (gcc/binutils)-arm-none-eabi 
>> recently and they have this 'flash configuration field' 
>> in those cortex m0plus thingies. 
>> It is 16 bytes large and sits at address 0x400 of the 
>> flash memory. There's usable flash before and after it. 
>> Currently I am having this config field in its own section 
>> and I am using a linker script to place it at a fixed address. 
>> this does generate a memory hole before it. 
>>
>> in the .S file:
>> [...]
>> .section .fconf
>> __fconf:
>>         .byte     BackDoorK0, BackDoorK1, BackDoorK2, BackDoorK3
>>         .byte     BackDoorK4, BackDoorK5, BackDoorK6, BackDoorK7
>>         .byte     0xFF,       0xFF,       0xFF,       0xFF
>>         .byte     EEPROT,      FPROT,     FSEC,       FOPT
>>         .size __fconf, . - __fconf
>> [...]
>>
>> in the linker script:
>> [...]
>> SECTIONS
>> {
>>         .text :
>>         {
>>                 KEEP(*(.isr_vector))
>>                 KEEP(*(.isr_vector_noncore))
>>                 . = 0x400;
>>                 KEEP(*(.fconf))
>>                 *(.text*)
>> [...]
>>
>>
>> Now I would like to use this space between the end of the 
>> isr vectors and the start of fconf. How to do that?
> 
> You can delete the . = 0x400; line, so .fconf will be just after the .isr_vector_noncore section.
> But then the .fconf will not be at a fixed address so it really depends how you access the .fconf bytes in your code. There is a way to know the starting (and ending) address of every section, check the linker file manual.
> The best (and easiest) thing I think is is to put them at a fixed address, but at the end of the flash.
> 
> Bye Jack
> 

The "fconf" section here must be at that specific address.  Although the
OP doesn't say so, I expect this is a Freescale/NXP Kinetis
microcontroller.  The microcontroller uses the configuration at that
specific address to determine things like flash security.

Back to comp.arch.embedded | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How do I get rid of a memory hole(in cortexm0plus)? Johann Klammer <klammerj@NOSPAM.a1.net> - 2016-10-30 09:29 +0100
  Re: How do I get rid of a memory hole(in cortexm0plus)? David Brown <david.brown@hesbynett.no> - 2016-10-30 16:50 +0100
  Re: How do I get rid of a memory hole(in cortexm0plus)? Jack <jack4747@gmail.com> - 2016-10-31 01:16 -0700
    Re: How do I get rid of a memory hole(in cortexm0plus)? David Brown <david.brown@hesbynett.no> - 2016-10-31 10:24 +0100
      Re: How do I get rid of a memory hole(in cortexm0plus)? Jack <jack4747@gmail.com> - 2016-10-31 02:43 -0700
        Re: How do I get rid of a memory hole(in cortexm0plus)? David Brown <david.brown@hesbynett.no> - 2016-10-31 11:12 +0100
          Re: How do I get rid of a memory hole(in cortexm0plus)? Jack <jack4747@gmail.com> - 2016-10-31 05:11 -0700
            Re: How do I get rid of a memory hole(in cortexm0plus)? Jack <jack4747@gmail.com> - 2016-10-31 05:23 -0700
              Re: How do I get rid of a memory hole(in cortexm0plus)? David Brown <david.brown@hesbynett.no> - 2016-10-31 14:24 +0100

csiph-web