Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

CooCox ARM Cortex M3 and Cortex M0 Development Tools

Status
Not open for further replies.
CooCox has optimized COX --- ARM Cortex M3 & M0 library and the Terms of Use

COX V1.0.0 was released in September 2010, and has been ported to several MCU platforms, such as LPC11xx, NUC1xx and so on.

COX V1.0.0 also provides a group of common functions for peripherals, but it has some drawbacks:
  • Does not support interrupt.
  • Does not have full functions. It just implements some of the most common functions, and can’t play the advantages of the special MCUs.
  • Does not support all the peripherals, users need to rely on the cooperation of other libraries. That will also leads to larger code size, and may have some conflicts for logic implementation.
So we re-wrote the COX. We have prepared for about one year for the new COX, each of whose interface was defined after having read and compared a number of chip manufacturers’ manuals. The current version of COX has solved all the problems above, and added some innovative things. Now the COX peripheral library can meet different needs.

Features of COX V2.0.0:
  • Free and open source under BSD license
  • Peripherals library with a unified standard interface, can be ported to other MCUs easily
  • Full functions of the peripheral, COX still provides a set of APIs for special MCU features
  • Support interrupt, COX extracts a set of interrupt events
  • A lot of reused drivers
  • Extensive documentation generated using doxygen standard
  • Standard definition of the API reference for almost all the Cortex-M0/M3 MCU manuals
  • Add a new innovative element, such as the short pin (PA2) in GPIO module
  • Strict coding standard and does not affect code size and speed, through rigorous testing and verification
  • Configurable
  • Provide blank template to make port more easily
Welcome to have a try and feed back.
 
Last edited:

It took a little longer than we expected to release CoIDE 1.3.1, due to several times of test and modification.

[CooCox CoIDE-Improved]
  • Added: Support Semihosting function
  • Added: Support NuVoton NUC122 series
  • Updated: The components and examples for Nuvoton's NUC1xx series, M051 series
  • Updated: The COX components upgrade to the newest version
  • Modified: Use the GCC compiler recompiled by CooCox to replace the old one
  • Corrected: The bug that ST-Link cannot use under win7 64 bit
  • Corrected: The bug related with Include paths, Custom Options
Welcome to have a try.
For more info, please visit Free ARM Cortex M3 and Cortex M0 IDE.
 
Last edited:

CoIDE Semihosting instructions for users

To use the function of Semihosting, you need to:

1. Select component Semihosting in Repository page;
2. Enable Semihosting in Debug Configuration;
3. Add SH_SendChar(c); to function Printchar() in file printf.c, and add #include "semihosting.h" to the top of the file;
4. Add printf("Hello world!\n\r"); (for example) where you want, and include <stdio.h> at the top of the file.

Ps: For most chips the steps above are suitable, for others like AT91SAM3Uxx, step 3 is a little different. You can view the example for component Semihosting and follow the instruction in the file comment.

Welcome to have a try.
Download and learn CoIDE from Free ARM Cortex M3 and Cortex M0 IDE.
 

General Mobilization of CoX Development

CooCox has spared no effort and spent one full year to rewrite CoX, the Uniformly Defined Driver Interface based on ARM Cortex M3 and Cortex M0, as I introduced in my former post.

The good news I’d like to inform you today is that CooCox has built up CoX Repository on GitHub. Therefore, you can get CoX resources or contribute to CoX conveniently through Git from now on. CoX Homepage on GitHub

What is GitHub and Git?

GitHub is a web-based hosting service for software development projects that use the Git version control system. GitHub offers both commercial plans and free accounts for open source projects.

Git is an extremely fast, efficient, distributed version control system ideal for the collaborative development of software, which is provided by GitHub.

If you want to contribute or get the full CoX repo on GitHub, you need to install Git.

Why Git?

Compared with other VCSs (version control systems), Git has the following overwhelming advantages:
  1. Snapshots, Not Differences
    - Extremely convenient for branching and merging.
  2. Nearly Every Operation Is Local
    -Most operations can still be realized offline, and the speed seem almost instantaneous.
  3. Git Has Integrity
    - You can’t lose information in transit or get file corruption without Git being able to detect it.
  4. Git Generally Only Adds Data
    -Once commited into Git, the snapshot/data is very difficult to lose. Just feel free to experiment.

How to contribute to CoX?

CooCox uses the Integration-manager workflow.

Because Git allows you to have multiple remote repositories, it’s possible to have a workflow where each developer has write access to their own public repository and read access to everyone else’s. This scenario often includes a canonical repository that represents the “official” project. To contribute to that project, you create your own public clone of the project and push your changes to it. Then, you can send a request to the maintainer of the main project to pull in your changes. They can add your repository as a remote, test your changes locally, merge them into their branch, and push back to their repository.

The process works as follows:
  1. The project maintainer pushes to their public repository.
  2. A contributor clones that repository and makes changes.
  3. The contributor pushes to their own public copy.
  4. The contributor sends the maintainer an e-mail asking them to pull changes.
  5. The maintainer adds the contributor’s repo as a remote and merges locally.
  6. The maintainer pushes merged changes to the main repository.

Integration-manager workflow.png

For more info, please visit CooCox - CoX Repository on GitHub.
 
Last edited:

CoAssistant, Your Effective Assistant on Register Info

Do you still refer to user manual now and then when programming? It’s outdated!

Now you have run into a good assistant with fortune, who will considerably lighten the burden of your eyes.

CooCox CoAssistant is a handy and practical register assistant, specially designed for ARM Cortex M3 & M0 developers.

Reasons for recommendation:
  1. No Need to Pay
    CooCox tools are all free and partly open source (Colink & CoLinkEx). You can visit Free and open ARM Cortex M3 and Cortex M0 embedded development tools for more details.
  2. Two Options – Online Version + CoIDE-Integrated Version
    In CoIDE, select View > Peripherals to open CoAssistant.
    Entry of CoAssistant online, see Free and Online ARM Cortex M3 and Cortex M0 Embedded Register Assistant.
  3. Intuitively Demonstrate Detailed Info of Registers
    Through CoAssistant, you can conveniently get the info below:
    • All register groups of a chip
    • Base address and description of a register group
    • All registers of a register group
    • Description, access, offset, reset value and the detailed info of each bit field of a register.

    Besides, when stepping in debug, register with value changed will highlight in red.

  4. Support Multi-methods to Modify Register Value and Real-time Response on Hardware
    1) Modify register value by binary and hexadecimal system, each bit will transform accordingly at the same time.
    For example, I modified the value of GPIOC_ODR from 0x00000240 to 0x00000200 when debug was paused, PC6 LED went off and PC9 LED was still on.


    2) For bit field which has enumeration values, you can also modify its value by clicking the bit field, or select a value from the drop down list of Option.


Currently CoAssistant supports ST, Nuvoton, NXP and Energy Micro chips.

Seeing is believing. Why not have a try?
 

CooCox has implemented NUC122 CoX Peripheral Interface

CoX, the Uniformly Defined Driver Interface based on ARM Cortex M3 and Cortex M0, the Driver Repository CooCox Team has been sparing no efforts to construct, was introduced before.

Currently the main developers of CoX are CooCox engineers. But with the debut of Component Platform later and the gradual growth of GitHub project, it’s predictable that more and more developers will join us, especially when the Component Platform provides a considerably simplified access to developing and uploading drivers.

Last week, CooCox has implemented NUC122 Peripheral Library based on CoX.

Refresh the Repository page of NUC122 in CoIDE, you will see branch PERIPHERAL.COX, which is NUC122 CoX Peripheral Interface. The components can be used once selected.

NUC122_CoX.jpg

You can also get Help document in format of Doxygen and download the CoX library directly from Optimize ARM Cortex M3 and M0 library - COX.
 

【FAQ】How to use C++ in CoIDE

Users asked on CooCox Forum now and then if CoIDE supports C++ or not.

Well, CoIDE supports only C language by default. *.cpp or *.C (a capital letter) files in CoIDE projects will not be compiled. What a pity!

Fortunately there are always more solutions than questions on earth. Now you can use C++ in CoIDE with just several modifications, thanks to Yury Kuchura for the contribution and sharing.

Here are the steps:

1. Edit build.xml so that *.cpp files can be compiled.
Code:
<fileset dir=".">
<include name="**/*.c"/>
[COLOR="#0000FF"]<include name="**/*.cpp"/>[/COLOR]
<include name="**/*.s"/>
</fileset>

2. Edit link.ld so that the linker can recognize several segments needed by C++.
Code:
/* Section Definitions */ 
SECTIONS 
{ 
[COLOR="#0000FF"]    .text : 
    { 
        KEEP(*(.isr_vector .isr_vector.*)) 
        *(.text .text.* .gnu.linkonce.t.*) 	      
        *(.glue_7t) *(.glue_7)		                
        *(.rodata .rodata* .gnu.linkonce.r.*)	
        
        /* C++ Static constructors/destructors (eabi) */
		. = ALIGN(4);
		KEEP(*(.init))
		
		. = ALIGN(4);
		__preinit_array_start = .;
		KEEP (*(.preinit_array))
		__preinit_array_end = .;
		
		. = ALIGN(4);
		__init_array_start = .;
		KEEP (*(SORT(.init_array.*)))
		KEEP (*(.init_array))
		__init_array_end = .;
		
		. = ALIGN(4);
		KEEP(*(.fini))
		
		. = ALIGN(4);
		__fini_array_start = .;
		KEEP (*(.fini_array))
		KEEP (*(SORT(.fini_array.*)))
		__fini_array_end = .;
		
		/* C++ Static constructors/destructors (elf) */
		. = ALIGN(4);
		_ctor_start = .;
		KEEP (*crtbegin.o(.ctors))
		KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
		KEEP (*(SORT(.ctors.*)))
		KEEP (*crtend.o(.ctors))
		_ctor_end = .;
		
		. = ALIGN(4);
		KEEP (*crtbegin.o(.dtors))
		KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
		KEEP (*(SORT(.dtors.*)))
		KEEP (*crtend.o(.dtors))	    	                  
    } > rom[/COLOR]
    
    .ARM.extab : 
    {
        *(.ARM.extab* .gnu.linkonce.armextab.*)
} > rom
…
…
    /* stack section */
    .co_stack (NOLOAD):
    {
        . = ALIGN(8);
        *(.co_stack .co_stack.*)
    } > ram
    
[COLOR="#0000FF"]    __exidx_start = .;
    .ARM.exidx :
    {
        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
    } > rom
    __exidx_end = .;[/COLOR]
    
       
    . = ALIGN(4); 
    _end = . ; 
}

3. Edit startup file so that it calls constructors of static objects.
Code:
…
[COLOR="#0000FF"]extern unsigned long __preinit_array_start;
extern unsigned long __preinit_array_end;
extern unsigned long __init_array_start;
extern unsigned long __init_array_end;
extern unsigned long _ctor_start;
extern unsigned long _ctor_end;
static void call_constructors(unsigned long *start, unsigned long *end) __attribute__((noinline));
static void call_constructors(unsigned long *start, unsigned long *end)
{
  unsigned long *i;
  void (*funcptr)();
  for ( i = start; i < end; i++)
  {
    funcptr=(void (*)())(*i);
    funcptr();
  }
}[/COLOR]
…
void Default_Reset_Handler(void)
{
…
  /* Setup the microcontroller system. */
  SystemInit();
    
[COLOR="#0000FF"]  //Initialize CoOS (in order the new/delete operators to work properly
  //prior to calling constructors). Comment it out if you don't use CoOS!
  CoInitOS();

  //Call C++ global constructors
  call_constructors(&__preinit_array_start, &__preinit_array_end);
  call_constructors(&__init_array_start, &__init_array_end);
  call_constructors(&_ctor_start, &_ctor_end);[/COLOR]

  /* Call the application's entry point.*/
  main();
}

4. Select component C Library and Retarget printf from the Repository View, then comment out the line below to avoid redefinition of _impure_ptr.
Code:
[COLOR="#0000FF"]struct _reent *_impure_ptr = &r;[/COLOR]

5. In project's Configuration, add two entries to "Linked Libraries" pane: libstdc++ and libsupc++, which can be found in GCC tool chain lib.

Sources:
http://www.coocox.org/Forum/topic.php?id=730
http://www.coocox.org/Forum/topic.php?id=873

Example in attachment: 103vb_cpp.zip
STM32103vb + CoIDE 1.3.1 + Blinky
Remark – The example was created by CoIDE 1.3.1, since in CoIDE 1.4.0 changes of build.xml cannot be saved. This bug will soon be solved in new version CoIDE.

Welcome to communicate and discuss on CooCox Forum.
 

Attachments

  • 103vb_cpp.zip
    220.7 KB · Views: 108
Last edited by a moderator:


Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top