Change the rate of the internal clock

Hi,
i have a Fez Cerb40 ii and i want to change the rate of the internal clock to watch the consumption of the microprocessor.
I code in c# and i haven’t idea to do this.
Clock Rate can be set in SPI_Configuration but it will not change anything at the micro processor.

Would you have any ideas?

ty

This is not directly supported but it is one of the items on our list and the wish list to Microsoft.

1 Like

Ok, ty for answer !

Hum, if this is not posssible in C #, it is possible to create DLL (for example using Assembly language or c + +) to do this? Or definitely not?

You can using RLP

ok, ty :slight_smile:

I did this on the G120 nxp chip.https://www.ghielectronics.com/community/codeshare/entry/876

Search for example C code or app notes on the ST website.

Bear in mind that it changes a lot of the derived rates like UART and system clock too.

I want to use rlp and i use thi page https://www.ghielectronics.com/docs/50/rlp#449

but i have a question at the end. Where find and add reference rlp for using “RLP.”
ex :
RLP.LoadELF(elf_file);
RLP.InitializeBSSRegion(elf_file);
SwapArray= RLP.GetProcedure(elf_file, “SwapArray”);
// We don’t need this anymore
elf_file = null;
// Your code

Which framework versions are you using? GHI have recently added the previously premium RLP functionality to the Cerb.

If you are using 4.3 add GHI.Hardware as a reference. It is now in GHI.Processor.RuntimeLoadableProcedure

It is now initialised like this:-


        static RuntimeLoadableProcedures.NativeFunction functionName;

        public void initRLP()
        {
            //Init RLP
            byte[] elf_file = Resources.GetBytes(Resources.BinaryResources.RLP_ELFfile);
            RuntimeLoadableProcedures.LoadElfImage(elf_file);
            RuntimeLoadableProcedures.InitializeBssRegion();
            functionName= new RuntimeLoadableProcedures.NativeFunction("RLPfunctionName");
           
            elf_file = null;
            RLPinitialised = true;
        }

i add “using GHI.Hardware;”

But having said that RuntimeLoadableProcedures does not exist in the current context.

And i use 4.3.
I have instal NETMF SDK 4.3 (RTM)

and in NETMF and Gadgeteer Package 2014 R1 :
.Net gadgeteer core
ghi glide sdk

The change that was made in the latest BETA3 release found here. https://www.ghielectronics.com/support/netmf/sdks

You can either upgrade or use RLPLite. I haven’t used this personally so am not much help. There is an example project on codeshare for it however. https://www.ghielectronics.com/community/codeshare/entry/895

i can’t add GHI.Processor by “using GHI.Processor;”

and the addition of a reference page does not contain much … when I use the 4.2 I lines with libraries “GHI.blablabla”

@ francois910 - GHI.Processor is part of the GHI 4.3 BETA release. You are running the final release of the 4.2 code. Although you have the Microsoft 4.3 core package installed the GHI extensions are at 4.2. As I said, you can run RLPlite which is part of a different namespace or upgrade to the latest Beta version.

yes sorry hagster, i write before look your message

i have install beta 3
and now i have in my reference page GHI composant (ghi.premnium.blabla, ghi.hardware.blabla,GHI.OSHW.blabla,GHIElectronics.blabla) but not GHI.processor

In this exemple project, he use ‘using GHI.Premium.Native;’ for me it’s GHI.OSHW.Native but when i write RLP.LoadELF(image); it’s said that rlp not exist in the actual context

Have you selected 4.3 as the target framework in the project settings?

Also, Simon’s emBlocks template is for the old RLPlite. You need to modify it to be like the G400 or G120 templates. It’s probably easiest to start with the G400 and swap the processor .h file for the stm32blah.h file and change the ELL base address and length to the correct size.

Hope it goes well, TOP is really not that difficult once you have it setup.

@ francois910 - If you still see GHI.Premium and GHI.OSHW libraries, it means you still have an older SDK installed. They do not work side by side. I would advise uninstalling everything NETMF and GHI related and then reinstall the beta 3 SDK at https://www.ghielectronics.com/support/netmf/sdk/16/netmf-and-gadgeteer-package-2014-r2-beta-3 if you want to use NETMF 4.3.

Once you do that, the GHI.Processor namespace exists in the GHI.Hardware dll. Add that reference to your project and you will have access to GHI.Processor.

1 Like

Ho, ok sorry, i never modify project setting^^

and now your code works hagster

thank you everyone

Well, I knew that I would come back soon. I have this error message:

Erreur 1 Cannot deploy the base assembly ‘mscorlib’, or any of his satellite assemblies, to device - USB:Gadgeteer twice. Assembly ‘mscorlib’ on the device has version 4.2.0.0, while the program is trying to deploy version 4.3.1.0

Yet I have to delete the reference 4.2 and version 4.3 added mscorlib.

Or maybe it’s just that the microprocessor does not support version 4.3?

And i used in 4.2
using GHI.Hardware.FEZCerb;
using GPM = GHI.OSHW.Hardware;
using GHI.OSHW.Native;

but what are the equivalents in 4.3?

your problem is that the firmware on the device is 4.2 and you are targeting 4.3. You can do one of two things - target 4.2 (and re-code as necessary) or put the 4.3 firmware on. FezConfig is the tool to do the latter.

Ho yes ok.

In 4.3, how to use the rtc? I used GHI.OSHW.Hardware;
Similarly, it does not recognize Pin. (Pin.PA13, Pin.PA7, etc.)