Compiling RTX Kernel files using GCC Compiler in Eclipse IDE - eclipse

We have a project in KEIL IDE for LPC2148 which has RTX kernel programs along with other programs in it, which was compiled by ARM CC.Now we need to change the IDE from KEIL(ARM CC) to Eclipse(GCC). When we tried to compile it in Eclipse GCC Compiler, it is showing errors in RTX_Config.c and RTX_Config.h files. Other files are compiled successfully using GCC compiler. But RTXConfig.c file has compiler specific codes which are not getting compiled by GCC. Is there any solution to compile this project in Eclipse IDE using GCC compiler? Please help me out in this as am a beginner. Thanks in advance
We have some keil specific keywords like irq , __swi, __task , __asm which is compiled successfully by ARM CC (keil), but when we tried to port it to GCC Compiler (Eclipse), This compiler cannot compile these keywords and showing errors.
Is there any way to compile these keil specific keywords in GCC Compiler?

do_software_interrupt, do_irq and do_fiq are interrupt service routines for SWI, IRQ and FIQ respectively. These functions are implemented in c using gcc’s attribute feature. Here is the actual c code containing routines for irq, fiq and software interrupt.
entry.c
void __attribute__((interrupt("IRQ"))) do_irq()
{
//your irq service code goes here
}
void __attribute__((interrupt("FIQ"))) do_fiq()
{
//your fiq service code goes here
}
void __attribute__((interrupt("SWI"))) do_software_interrupt()
{
volatile unsigned int int_num;
asm("LDR r0, [lr, #-4]");
asm("BIC r0, #0xFF000000");
asm("MOV %0, r0":"=r"(int_num):);
//based on int_num, you can determine which system call is called
}
void c_start() {
asm volatile ("SVC 0x5");
while(1){}
}

Related

G_DECLARE_FINAL_TYPE() throws compiler error

I have written a programm in C and GTK3. I am using Arch Linux and everything works fine. However, I have to use my program also on a rather old Ubuntu machine.
gtk+-3.0 3.10.8
GCC 4.8.4
With this setup the program does not compile
In the Header file of a custom GTK-Widget I have:
#ifndef __LAYER_ELEMENT_H__
#define __LAYER_ELEMENT_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(LayerElement, layer_element, LAYER, ELEMENT, GtkListBoxRow)
/* Rest of file comes here */
When compiling it throws the error message:
expected ')' before GtkListBoxRow in the line with the G_DECLARE_FINAL_TYPE macro.
How can I fix this issue?
G_DECLARE_FINAL_TYPE was added to GLib in version 2.44 (see the documentation). If you want to compile on an old version of Ubuntu, you will either have to get hold of a backport of GLib 2.44 (or later) for that version of Ubuntu, and compile against that; or you will have to modify your code to not use any GLib APIs added after version 2.40.

Arduino Linux mint: error: ‘digitalPinToInterrupt’

I wanted to interrupt a simple squared voltage and I was using a common program:
const byte ledPin = 13;
const byte interruptPin = 2;
volatile byte state = LOW;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(interruptPin, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(interruptPin), blink, CHANGE);
}
void loop() {
digitalWrite(ledPin, state);
}
void blink() {
state = !state;
}
But if I want to verify it with the Arduino Software, this is the error:
interrupt.ino: In function ‘void setup()’:
interrupt.ino:11:53: error: ‘digitalPinToInterrupt’ was not declared in this scope
I already tried adding libraries, which include this command, but I had problems finding them.
I am using Linux mint and the Arduino software version is:
arduino:
Installed: 2:1.0.5+dfsg2-4
Candidate: 2:1.0.5+dfsg2-4
Version table:
*** 2:1.0.5+dfsg2-4 500
And I couldn't install the IDE which I downloaded from https://www.arduino.cc
So this is the version of the package manager in Linux mint.
My question now is, does someone know where to find the libary which includes digitalPinToInterrupt().
There is no libary manager in this version of IDE, so perhaps someone knows how to get a newer version of IDE for Linuxmint.
Thank you
SOLVED
The version 1.8.2 for Linux 64bit on https://www.arduino.cc/en/Main/Software is defective. I found an other one on http://www.arduino.org/downloads.
This version also already includes digitalPinToInterrupt().

RTX implementation with eclipse

I have a question about RTX (RTOS), I have to implement the RTOS RTX on a NUCLEO-F411RE board (Cortex M4). I have to do it with Eclipse but I don't know how I should do.
Moreover, I tried to compile it with the gcc compiler and I had many errors like :
_ error: stray '#' in program
_ error: expected '(' before 'void' __asm void rt_set_PSP (U32 stack) {
Can someone help me to fix it?
Keil's MDK-ARM includes a plug-in for Eclipse as an alternative to using µVision. That would be the most straightforward way to start developing with Eclipse. It supports importing/exporting projects to and from µVision.
The errors you have are most likely due to attempting to compile ARM RealView compiler (armcc) specific code with gcc.

Getting Eclipse to recognize automatic CUDA kernel variables and functions

Is there a way to get Eclipse (Indigo) to know about the built-in variables and functions that are available to CUDA kernels?
Consider the following simple kernel
__global__ void myKernel()
{
int x = threadIdx.x;
__syncthreads();
}
The Eclipse IDE highlights "threadIdx" and "__syncthreads" with a "Symbol 'the built-in symbol' could not be resolved" error message. Is there a way to tell Eclipse these are actually implicitly defined?
flipchart is correct. #include <cuda_runtime_api.h> does the trick if the symbol __CUDACC__ is defined beforehand.
In cuda 11.3 you can add:
#include <device_launch_parameters.h>

Static linking issue on Solaris sparc

Undefined symbols Error while statically linking xerces with application only on solaris sparc, whereas static linking on other platforms(Linux, HP-UX,Solaris-x86) working.
Here are errors.
Undefined first referenced
symbol in file
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::XMLNotationDecl>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(XMLNotationDecl.o)
const xercesc_2_8::XMLAttr*xercesc_2_8::BaseRefVectorOf<xercesc_2_8::XMLAttr>::elementAt(const unsigned)const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(SAX2XMLReaderImpl.o)
void xercesc_2_8::RefHashTableOf<xercesc_2_8::KVStringPair>::put(void*,xercesc_2_8::KVStringPair*const) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(DatatypeValidatorFactory.o)
socket /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(UnixHTTPURLInputStream.o)
xercesc_2_8::SchemaElementDecl*xercesc_2_8::Janitor<xercesc_2_8::SchemaElementDecl>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::ValueVectorOf<xercesc_2_8::DOMNode*>::addElement(xercesc_2_8::DOMNode*const&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(GeneralAttributeCheck.o)
unsigned xercesc_2_8::RefHashTableOf<xercesc_2_8::XercesAttGroupInfo>::getHashModulus()const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(XTemplateSerializer.o)
bool xercesc_2_8::RefHashTableOf<xercesc_2_8::XMLAttDef>::containsKey(const void*const)const /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::IdentityConstraintHandler>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(IdentityConstraintHandler.o)
xercesc_2_8::XMLHolder<_pthread_mutex>::~XMLHolder() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(SolarisPlatformUtils.o)
void xercesc_2_8::ValueHashTableOf<unsigned short>::put(void*,const unsigned short&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(GeneralAttributeCheck.o)
void xercesc_2_8::ValueHashTableOf<unsigned>::put(void*,const unsigned&) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
xercesc_2_8::RefVectorOf<xercesc_2_8::DOMImplementationSource>::~RefVectorOf() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(DOMImplementationRegistry.o)
void xercesc_2_8::JanitorMemFunCall<xercesc_2_8::FieldValueMap>::release() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(FieldValueMap.o)
void xercesc_2_8::Janitor<xercesc_2_8::SchemaAttDef>::orphan() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
xercesc_2_8::SchemaInfo&xercesc_2_8::BaseRefVectorEnumerator<xercesc_2_8::SchemaInfo>::nextElement() /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TraverseSchema.o)
void xercesc_2_8::BaseRefVectorOf<xercesc_2_8::ENameMap>::addElement(xercesc_2_8::ENameMap*const) /src/xerces_stat_libs/Solaris28-sun4/libxerces-c.a(TransService.o)
Sachin,can you please provide your link line, as reported by your build system?
This will show what libraries are being used in what order and what flags are being invoked. (I expect this is a CC command, not ld.)
Also to respond to Erik, Solaris 10 does support static linking -- you can link a static library (.a file) with your binary -- what it doesn't support is linking the Solaris system libraries statically. Sachin, from the errors it look like you're linking your own static xerces library against your binary, which is fine in S10.
As far as compiling and linking is concerned, there is no difference between Solaris running on x86 and SPARC. You certainly can build and link with static libraries on Solaris 10 (and 11). One notable exception would be the C library which is only provided as a dynamic library, but the error messages you show are unrelated to libc.
What version of solaris are you using? If it's solaris 10 then you're out of luck, it no longer supports static linking.
See here.