Discussion in "ARM Development" started by    vahid_6485    Feb 29, 2012.
Wed Feb 29 2012, 01:58 pm
#1
Hi all, I have a OK6410 board with ARM1176jzf-s processor and linux operating system, and i want to build a program that contains some class in c and some methods with arm standard assembly , my sample codes are:
Main.c
#include <stdio.h>
#include "pmu.h"

int main(void)
{
prinf("Before Call Function");
enable_pmu();
printf("After call Function");

return 0;
}

Pmu.h
void enable_pmu(void);

pmu.S
; ------------------------------------------------------------
; PMU access functions for ARM11 (v6)
;
; This example code is provided "as is", with out warranty
; or support entitlement. No liability is accepted.
; ------------------------------------------------------------

PRESERVE8

AREA v6_pmu, CODE,READONLY

ARM
; ---------------------------------------------------------------
; Enable/Disable
; ---------------------------------------------------------------

EXPORT enable_pmu
; void enable_pmu(void)
enable_pmu PROC
MRC p15, 0, r0, c15, c12, 0 ; Read Performance Monitor Control Register
ORR r0, r0, #0x01 ; Set E bit
MCR p15, 0, r0, c15, c12, 0 ; Write Performance Monitor Control Register
BX lr
ENDP


As you see above the assembly codes are for using performance monitoring unit of ARM11, I has written in arm standard assembly to configure Coprocessor, how can I build this program to run on linux?
I can’t find any conversion of this assembly codes to GNU assembly for arm, is there any suggestion?
I used Eclipse IDE for C/C++ Developers(Indigo Service Release 1) and Sorcery Codebench lite(arm-2011.09-70-arm-none-linux-gnueabi), but I cannot build that!
Please help how can I build and run this program on my board?
Best regards
Sun Mar 04 2012, 03:25 am
#2
are you getting any errors? and how you're building this code.. provide steps..

toolchain is fine.. dont you use makefile or something?
Thu Mar 22 2012, 08:35 am
#3
Hi, I'm using the same OK6410 with 4.3" LCD board from http://www.arm9board.net/sel/prddetail.aspx?id=348&pid=200.

But I can't find the source code you mentioned in the shipped DVD, could you post a path? thanks!

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am
Adamsaf
Sat Apr 27 2024, 07:12 am
Robertphype
Sat Apr 27 2024, 12:23 am
ktaletrryp
Fri Apr 26 2024, 10:55 pm
Robertrip
Fri Apr 26 2024, 11:20 am