How can I create my own library?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How can I create my own library?

跳至解决方案
1,815 次查看
cody1
Contributor III

I use MC56F83783, then I program some functions which include some assembly code in the C function.

I used these assembly codes (MLIB/GFLIB) to write down new functions in C. Now, I want to block these new C functions to my library.

Is there any example that can teach me how to do it?

0 项奖励
1 解答
1,768 次查看
cody1
Contributor III

Excuse me, I said something wrong. About the ASM code in the C function that can not work. When I create a simple app and paste the library into this project, then I test it again. I found that it's work. Maybe I done another mistake cause the project can not work. I will keep debugging it. If I find the bug, then I will ask you again.

Thanks for your help.

Cody

在原帖中查看解决方案

0 项奖励
6 回复数
1,808 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

From your description, it appears that you want to develop your own library, this is the procedure:

1)File->New->bareboard Project, you will se the menu as following:

2)in the main.c, delete all the main function

3)add your own api function and compile.

Hope it can help you

BR

XiangJun Rong

xiangjun_rong_0-1639374225122.png

 

0 项奖励
1,796 次查看
cody1
Contributor III

I follow your step to create a library like the attached file. I pasted the output file of the library to my application project, then I build it again. I got a fail message. The message is shown below.

Image 1.jp.jpg

0 项奖励
1,790 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I have checked your code, it is okay to generate library.

But for your compilation error, it is another question, I do not have your data structure, pls solve it yourself.

BR

XiangJun Rong

0 项奖励
1,780 次查看
cody1
Contributor III
When building the library, do I need to bring MILB-related files into the project library? I tried it before. I copied some ASM code from MLIB into my library and then built them again. I copied the build output files into my application project, and then built them again, they can compile my application completely and show no errors. Then I started testing the functions in the library. I found that all C functions that do not contain any ASM code can work. Some ASM code in C functions cannot run.
Could you keep helping me, please?
 
Thanks
 
Cody
0 项奖励
1,773 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I can pass the compilation and link stages for your project, for your issue that you can NOT run the code, can you clarify the code which can not run so that I can have a check.

BR

XiangJun Rong

0 项奖励
1,769 次查看
cody1
Contributor III

Excuse me, I said something wrong. About the ASM code in the C function that can not work. When I create a simple app and paste the library into this project, then I test it again. I found that it's work. Maybe I done another mistake cause the project can not work. I will keep debugging it. If I find the bug, then I will ask you again.

Thanks for your help.

Cody

0 项奖励