FEZ Hydra build: 'PWM_SCALE_FACTOR' has not been declared

I’m trying to build the FEZ Hydra solution in .NET Micro Framework 4.2. GCC is complaining:

c:\MicroFrameworkPK_v4_2\devicecode\Targets\Native\AT91/DeviceCode\AT91.h:1995: error: ‘PWM_SCALE_FACTOR’ has not been declared

Does anyone know if the current snapshot on http://ghiopensource.codeplex.com/ is broken?

Also, is this the right place to talk about this? Would the Codeplex page be a better place to discuss this?

You need 4.2 PK QFE1.

Alright, thanks – those errors went away.

Now I’m getting missing projects errors. I noticed in \Solutions\FezHydra\DeviceCode\blockstorage, there’s two zip files that contained project files that weren’t in that folder. I went ahead and unzipped them. That fixed a couple of the errors, but there’s still several projects missing:

\Solutions\FEZ_Hydra\DeviceCode\TX09D71VM1CCA
\Solutions\FEZ_Hydra\DeviceCode\Init
\Solutions\FEZ_Hydra\DeviceCode\usb_config
\Solutions\FEZ_Hydra\DeviceCode\FS
\Solutions\FEZ_Hydra\DeviceCode\TouchPanel_HAL
\Solutions\FEZ_Hydra\DeviceCode\VirtualKey
\Solutions\FEZ_Hydra\DeviceCode\ENC28J60_Config_LWIP_HAL
\Solutions\FEZ_Hydra\DeviceCode\Network_COnfig_HAL
\Solutions\FEZ_Hydra\DeviceCode\touchpanel\config\

Again, I grabbed the version off http://ghiopensource.codeplex.com. I browsed the codebase just now and didn’t see any of those folders in the DeviceCode folder for FEZ Hydra. Am I supposed to copy those files from somewhere else? Or deactivate them in the solution configuration tool?

All code should be up there now. Let us know if anything else is missing.

Great, I got everything compiled!

Since GHI uses MDK to compile their code, it looks like no one bothered to update the GCC scatter file to get the project to link correctly. After making appropriate changes, I was able to get it compiled and deployed. It actually works! (I was surprised myself!)

If anyone else is trying to compile the firmware with GCC, I’ve pasted the scatter file I used to the bottom of this message.

GHI may want to stick it into their codeplex source code so others don’t have to modify it to get the design to compile.

<?xml version="1.0"?>
<ScatterFile xmlns="http://schemas.microsoft.com/netmf/ScatterfileSchema.xsd">

    <Set Name="Valid" Value="false"/>

    <!-- ################################################################################ -->
    <Set Name="Heap_Begin"          Value="0x20600000"/> <!--Value="0x23000000"/> -->
    <Set Name="Heap_End"            Value="0x20DFFFF8"/> <!--Value="0x237FFFF8"/> -->
    <Set Name="Custom_Heap_Begin"    Value="0x20400000"/><!--Value="0x23800000"/> -->
    <Set Name="Custom_Heap_End"      Value="0x205FFFF8"/> <!--Value="0x23DFFFF8"/> -->
    <Set Name="Stack_Bottom"         Value="0x308000"/><!--Value="0x23E00000"/> -->
    <Set Name="Stack_Top"            Value="0x30FFF0"/><!--Value="0x23EFFFF8"/> -->

    <If Name="TARGETLOCATION" In="FLASH">

        <Set Name="Code_BaseAddress"    Value="0x20100000"/> <!-- Value="0x20040000"/> -->
        <Set Name="Code_Size"           Value="0x00200000"/> <!-- Value="0x00100000"/> -->

<!-- Config_BaseAddress it the NAND address -->


        <Set Name="Config_BaseAddress"  Value="0x0041df00"/>   <!-- Value="0x00040000"/>  -->   

<!-- ERConfig_BaseAddress is in RW -->
        <Set Name="ERConfig_BaseAddress" Value="0x203F0000"/> <!-- Value="0x22E00000"/> -->    
        <Set Name="Config_Size"         Value="0x0002100"/> <!-- Value="0x00020000"/> -->

       <!--  <Set Name="Data_BaseAddress"     Value="0x001C0000"/>
        <Set Name="Deploy_BaseAddress"   Value="0x00300000"/> -->
        <Set Name="Valid"                Value="true"/>
       <!--  <Set Name="Data_Size"            Value="%Deploy_BaseAddress - Data_BaseAddress%"/> -->
    </If>

    <If Name="TARGETLOCATION" In="RAM">

       <!--  <Set Name="ProfileBuffer_Begin" Value="0x22000000"/>
        <Set Name="ProfileBuffer_End"   Value="0x2200FFF8"/> -->
        <Set Name="Code_BaseAddress" Value="0x20100000"/>   <!--  Value="0x22010000"/> -->
        <Set Name="Code_Size"        Value="0x00200000"/> <!--   Value="0x00FF0000"/> -->
        <!-- RAM with FLASH config is not needed -->
        <Set Name="Valid"               Value="true"/>

    </If>


    <!-- ################################################################################ -->

    <If Name="Valid" Value="false">
        <Error Message="Configuration not recognized"/>
    </If>

    <!-- we start at 0x10080000 since PortBooter lives at 0x10000000 -->

    <NamedGroup Name="MEMORY">
      <LoadRegion Name="LR_%TARGETLOCATION%" Base="%Code_BaseAddress%" Size="%Code_Size%"/>
      <IfDefined Name="Config_BaseAddress">
        <LoadRegion Name="LR_CONFIG" Base="%Config_BaseAddress%" Size="%Config_Size%"/>
        <LoadRegion Name="ER_CONFIG_AREA" Base="%ERConfig_BaseAddress%" Size="%Config_Size%"/>
	
      </IfDefined>
      <IfDefined Name="Data_BaseAddress">
        <LoadRegion Name="LR_DAT" Base="%Data_BaseAddress%" Size="%Data_Size%"/>
      </IfDefined>
      <LoadRegion Name="HEAP" Base="%Heap_Begin%" Size="%Heap_End - Heap_Begin% + 1"/>
      <LoadRegion Name="STACK" Base="%Stack_Bottom%" Size="%Stack_Top - Stack_Bottom% + 1"/>
     <!--64Kbyte SRAM -->
      <!-- <LoadRegion Name="RELOC_RAM" Base="0x00000000" Size="0x1000"/> -->
	  <LoadRegion Name="RELOC_RAM" Base="0x20300000" Size="0x20000"/>
      <LoadRegion Name="RELOC_SDRAM" Base="0x21000000" Size="0x1000000"/>

    </NamedGroup>

    <EntryPoint Name="EntryPoint"/>

    <NamedGroup Name="SECTIONS">
      <ExecRegion Name="ER_%TARGETLOCATION%" Options=">LR_%TARGETLOCATION%">
        <FileMapping Name="*" Options="(i.EntryPoint)" />
        <FileMapping Name="*" Options="(SectionForBootstrapOperations)" />
        <FileMapping Name="*" Options="(.text*)" />
        <FileMapping Name="*" Options="(i.*)" />
        <FileMapping Name="*" Options="(t.*)" />
        <FileMapping Name="*" Options="(.rodata*)" />
        <FileMapping Name="*" Options="(rodata)" />
        <FileMapping Name="*" Options="(.constdata*)" />
        <FileMapping Name="*" Options="(.conststring*)" />
        <FileMapping Name="*" Options="(.glue*)" />
       <IfNotDefined Name="Data_BaseAddress">
          <FileMapping Name="*" Options="(tinyclr_metadata)" />
        </IfNotDefined>
        <IfNotDefined Name="Config_BaseAddress">
          <FileMapping Name="*" Options="(SectionForConfig)" />
        </IfNotDefined>
        <If Name="TARGETLOCATION" In="RAM">     
          <FileMapping Name="*" Options="(SectionForFlashOperations)" />       
        </If>

          <FileMapping Name="*" Options="(SectionForFlashOperations)" />       
        <!-- libc thinks that it needs these routines, but they are never called -->
        <Provide Name="_sbrk" />

        <Provide Name="_write" />

        <Provide Name="_close" />

        <Provide Name="_fstat" />

        <Provide Name="_lseek" />

        <Provide Name="_read" />

        <Provide Name="_exit" />

        <Provide Name="_getpid" />

        <Provide Name="_kill" />

        <Provide Name="abort" />

        <Provide Name="__errno" />

        <Provide Name="_read" />

        <Provide Name="isatty" />

        <Provide Name="_isatty" />

        <FileMapping Name="LONG(0xE12FFF1E);" />
      </ExecRegion>
      <ExecRegion Name="ER_RAM_RO" Align="0x10" Options=">RELOC_RAM AT>LR_%TARGETLOCATION%">
        <FileMapping Name="*" Options="(VectorsTrampolines)" />
        <Include File="%SPOCLIENT%\Solutions\%PLATFORM%\TinyCLR\scatterfile_ram_functions.xml"/>
        <Include File="%SPOCLIENT%\Solutions\%PLATFORM%\TinyCLR\scatterfile_tinyclr_ram_functions.xml"/>
        <FileMapping Name="*" Options="(SectionForBootstrapInRam)" />
        
      </ExecRegion>      
      <ExecRegion Name="ER_RAM_RW" Align="0x10" Options=">RELOC_RAM AT>LR_%TARGETLOCATION%">
        <FileMapping Name="*" Options="(rwdata)" />
        <FileMapping Name="*" Options="(.data*)" />
      </ExecRegion>      
      <ExecRegion Name=".bss" Align="0x10" Options=">RELOC_RAM">
        <FileMapping Name="*" Options="(.bss*)" />
        <FileMapping Name="*" Options="(.zidata*)" />
        <FileMapping Name="PROVIDE(__exidx_start = .);" />
        <FileMapping Name="PROVIDE(__exidx_end = .);" />
      </ExecRegion>
      <ExecRegion Name="/DISCARD/">
        <FileMapping Name="*" Options="(.ARM.exidx*)" />
        <FileMapping Name="*" Options="(.ARM.extab*)" />
      </ExecRegion>
      <ExecRegion Name="ER_HEAP_BEGIN" Base="%Heap_Begin%">
        <FileMapping Name="*" Options="(SectionForHeapBegin)" />
      </ExecRegion>
      <ExecRegion Name="ER_HEAP_END" Base="%Heap_End%">
        <FileMapping Name="*" Options="(SectionForHeapEnd)" />
      </ExecRegion>
      <ExecRegion Name="ER_STACK_BOTTOM" Base="%Stack_Bottom%">
        <FileMapping Name="*" Options="(SectionForStackBottom)" />
      </ExecRegion>
      <ExecRegion Name="ER_STACK_TOP" Base="%Stack_Top%">
        <FileMapping Name="*" Options="(SectionForStackTop)" />
      </ExecRegion>
    <ExecRegion Name="ER_CUSTOM_HEAP_BEGIN" Base="%Custom_Heap_Begin%">
      <FileMapping Name="*" Options="(SectionForCustomHeapBegin)" />
    </ExecRegion>
    <ExecRegion Name="ER_CUSTOM_HEAP_END" Base="%Custom_Heap_End%">
      <FileMapping Name="*" Options="(SectionForCustomHeapEnd)" />
    </ExecRegion>

    <IfDefined Name="Config_BaseAddress">         
      <ExecRegion Name="ER_CONFIG" Options=">ER_CONFIG_AREA AT>LR_CONFIG">
        <FileMapping Name="*" Options="(SectionForConfig)" />
      </ExecRegion>
    </IfDefined>    
    
    <IfDefined Name="Data_BaseAddress">      
      <ExecRegion Name="ER_DAT" Options=">LR_DAT">
        <FileMapping Name="*" Options="(tinyclr_metadata)" />
      </ExecRegion>
    </IfDefined>
    </NamedGroup>

    <!-- The following variables are used to simulate the ones autogenerated by RVDS -->
    <GlobalVariable Name="Load$$ER_%TARGETLOCATION%$$Base"          Value="ADDR(ER_%TARGETLOCATION%)"/>
    <GlobalVariable Name="Image$$ER_%TARGETLOCATION%$$Length"       Value="SIZEOF(ER_%TARGETLOCATION%)"/>
    <GlobalVariable Name="Image$$ER_RAM_RO$$Base"                   Value="ADDR(ER_RAM_RO)"/>
    <GlobalVariable Name="Image$$ER_RAM_RO$$Length"                 Value="SIZEOF(ER_RAM_RO)"/>
    <GlobalVariable Name="Load$$ER_RAM_RO$$Base"                    Value="LOADADDR(ER_RAM_RO)"/>

    <GlobalVariable Name="Image$$ER_RAM_RW$$Base"                   Value="ADDR(ER_RAM_RW)"/>
    <GlobalVariable Name="Image$$ER_RAM_RW$$Length"                 Value="SIZEOF(ER_RAM_RW)"/>
    <GlobalVariable Name="Load$$ER_RAM_RW$$Base"                    Value="LOADADDR(ER_RAM_RW)"/>

    <GlobalVariable Name="Image$$ER_RAM_RW$$ZI$$Base"               Value="ADDR(.bss)"/>
    <GlobalVariable Name="Image$$ER_RAM_RW$$ZI$$Length"             Value="SIZEOF(.bss)"/>
    <GlobalVariable Name="__use_no_semihosting_swi"                 Value="0"/>

</ScatterFile>


1 Like

Congratulations…!!! that is good news… i believe others have tried but failed…glad you got it working.

Excellent news! Now to work on the STM32 port :wink:

Send me a copy of MDK and I’ll get on it :slight_smile:

I tried to use Solution Wizard just now to Clone the solution to something I can play around with, and although TinyCLR compiles fine and flashes fine to the FEZ Hydra, when I try to deploy a program, I get this nondescript error:

Incrementally deploying assemblies to device
Assemblies not successfully deployed to device.
Deployment to the device was not successful.

I have an LCD plugged into the FEZ hydra and I see the correct build date, followed by “Waiting for debug commands…”

Any ideas?

We do not usually use this wizard internally. The netmf codeplex may have more info.