Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

stotech

Member Since 05 Aug 2012
Offline Last Active Oct 20 2015 11:22 PM
-----

Topics I've Started

Compiling Firmware with Keil evaluation.

25 May 2015 - 04:58 AM

Hi everyone. Ive got keil installed and Ive challenged myself to compile the firmware for the NP2. From there Ill try and make the changes needed to get it working on an STM32F407IGT6

Here is what Ive done so far.

Prerequisites:

How to build the firmware with Keil;

         Install Keil eval (you need to email them to arrange a trial). Mine installed to C:\keil_v5

         Install .NET Micro Framework Porting Kit 4.3 QFE1 (C:\MicroFrameworkPK_v4_3)

         Make a folder C:\Porting

         Copy C:\MicroFrameworkPK_v4_3 to C:\Porting\PK_v4_3

         Extract Netduino 2 Firmware v4.3.1 source to C:\Porting\NP2_v4_3

         Make a folder C:\Porting\Mixed

         Copy C:\Porting\PK_v4_3 to C:\Porting\Mixed overwrite all.

         Copy C:\Porting\NP2_v4_3 to C:\Porting\Mixed overwrite all.

         Navigate to C:\Porting\Mixed\Solutions\NetduinoPlus2\TinyBooter and make a copy of scatterfile_bootloader_rvds.xml. Rename it to scatterfile_bootloader_mdk.xml. (We might have to make some changes to this later???)

         Launch cmd.exe (note: I cant use Msbuild in cmd.exe. For some reason I need to launch C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Visual Studio 2012\Visual Studio Tools\ VS2012 x86 Native Tools Command Prompt) I dont know why?

         Use these commands

cd porting\mixed
setenv_base.cmd MDK5.14 PORT C:\keil_v5
Msbuild Solutions\NetduinoPlus2\dotnetmf.proj /T:rebuild /p:flavor=release;tcp_ip_stack=lwip /filelogger

And this is where Im up to.

 

 

Only 2 Errors, (see attached file) Im appealing to the community to help me finish this guide.

 

Thanks in advance.

 


Garbage Collector, SD Card, Stream Writer, Ram

06 April 2015 - 12:03 AM

Please Help!
I'm running out of ram all the time when i try and write to the SD card, But it says I've got heaps spare. Here is my code.
 
public static void Writer(string msg, string path, string file)
        {
            Debug.GC(true);
            Debug.Print("mem:  " + Debug.GC(true));

            lock (CardLock)
            {
                //SDC_flushSlow();
                int bufferSize = msg.Length;

                Debug.Print("Attempting to write with buffer of " + bufferSize.ToString());

                try
                {
                    if (Detect.SD_Card() & File.Exists(path + file))
                    {
                        using (var writestream = new FileStream(path + file, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite, bufferSize))
                        {
                            StreamWriter SW = new StreamWriter(writestream);
                            SW.Write(msg);
                            SW.Flush();
                            SW.Close();
                        }
                    }
                    else if (Detect.SD_Card())
                    {
                        if (!Directory.Exists(path))
                        {
                            Directory.CreateDirectory(path);
                        }
                        using (var writestream = new FileStream(path + file, FileMode.Create, FileAccess.ReadWrite, FileShare.ReadWrite, bufferSize))
                        {
                            StreamWriter SW = new StreamWriter(writestream);
                            SW.Write(msg);
                            SW.Flush();
                            SW.Close();
                        }
                    }
                }
                catch (Exception e)
                {
                    Debug.Print("SD_Writer Failed " + e.Message);
                }

                DebugLED.Show(15, 500);
            }
        }
But I get this every time.
 

SDC_Flushed and remounted
mem: 24732
Attempting to write with buffer of 1074
Failed allocation for 343 blocks, 4116 bytes
Failed allocation for 343 blocks, 4116 bytes
A first chance exception of type 'System.OutOfMemoryException' occurred in System.IO.dll
SD_Writer FailedException was thrown: System.OutOfMemoryException
 
Ok, Ive got an idea that might be causing it. Do you think that it could be that I have about three threads running at this stage?
 
if I call this:
 
Debug.GC(true)

Debug.Print("mem: " + Debug.GC(true));

 

Then it says I have 24k spare.
But the it cant find a 4k in a row to open the stream writer.
Could it be that the 2 other threads are preventing the garbage collector from moving memory objects. Does the garbage collector run across all threads or only the one it is called in?
 
Thanks So much in advance.

Compiling Custom Firmware. emIDE?

04 April 2015 - 07:12 AM

I've been trying to learn how to port cause i want to make a netduino with more pins using the STM32F407IG. I've read for days and followed tons of guides, but can't get any cmd line compilers to run using any guide. see the following. Not sure if it's cause i'm under windows 8?

C:\Porting\NP2\NetduinoPlus2>setenv_base.cmd GCC4.7.2  c:\yagarto
Compiler: GCC4.7.2 c:\yagarto
The system cannot find the path specified.

C:\Porting\NP2\NetduinoPlus2>Msbuild Solutions\NetduinoPlus2\dotnetmf.proj /T:re
build /p:flavor=release;tcp_ip_stack=lwip /filelogger
'Msbuild' is not recognized as an internal or external command,
operable program or batch file.

Trust me it's there. But doesn't work even if i use the GCC compiler from CW2's guide. 

Then i found this program called emIDE. It was actually recommended on the yagarto site. It seems super stable and has a pretty nice gui. So i tryed compiling with that but get a couple of warnings during the build. But it doesn't seem to spit out any files? Does anyone have time to try it out. might be worth looking into a nicer gui compiler. If not I'd really appreciate any help getting started with why those other compilers weren't working.

 

Thanks in advance.


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.