keil

How can I change maximum available heap size for a task in FreeRTOS?

馋奶兔 提交于 2019-12-02 03:23:40
I'm creating a list of elements inside a task in the following way: l = (dllist*)pvPortMalloc(sizeof(dllist)); dllist is 32 byte big. My embedded system has 60kB SRAM so I expected my 200 element list can be handled easily by the system. I found out that after allocating space for 8 elements the system is crashing on the 9th malloc function call (256byte+). If possible, where can I change the heap size inside freeRTOS? Can I somehow request the current status of heap size? I couldn't find this information in the documentation so I hope somebody can provide some insight in this matter. Thanks

How to print unsigned char as 2-digit hex value in C?

萝らか妹 提交于 2019-12-01 16:42:12
I am trying to printout an unsigned char value as a 2-Digit hex value, but always getting the result as 4-Digit hex values, not sure what's wrong with my code. // unsigned char declaration unsigned char status = 0x00; // printing out the value printf("status = (0x%02X)\n\r", (status |= 0xC0)); I am expecting a 2 digit hex result as 0xC0 , but I always get 0xC0FF . As well, when I tried to print the same variable (status) as an unsigned char with the %bu format identifier I got the output as 255 . How do you get just the two hex characters as output? As far as I know, the Keil C compiler doesn

How to print unsigned char as 2-digit hex value in C?

孤人 提交于 2019-12-01 16:04:02
问题 I am trying to printout an unsigned char value as a 2-Digit hex value, but always getting the result as 4-Digit hex values, not sure what's wrong with my code. // unsigned char declaration unsigned char status = 0x00; // printing out the value printf("status = (0x%02X)\n\r", (status |= 0xC0)); I am expecting a 2 digit hex result as 0xC0 , but I always get 0xC0FF . As well, when I tried to print the same variable (status) as an unsigned char with the %bu format identifier I got the output as

Source Insight 4.0 调用keil for arm 5.21进行编译

[亡魂溺海] 提交于 2019-12-01 14:44:34
Source Insight 4.0 调用keil for arm 5.21进行编译 本人声名,这里的东西笔记的成分要大一些。如有错误敬请指正。` 联系邮箱:andrew_bruce@163.com 作 者:Andrew 前言:作为一个新进职场的小白,每天面对代码进行修改和编译,在这个过程中遇到了Source Insight软件,这个软件很大程度的给我分析代码带来了方便,但是在Source Insight软件修改过代码后,还需要在Keil在进行编译,两个软件的频换切换让我十分头疼。我在想有什么方式能将两者的优势进行结合,在看到“xplain”的《 在source insight中编译arm程序》( 这儿 )对我有所启发,乘着下午没事,就自己摸索起来。 一、按照前言提到的文章指示,设置keil输出*.bat文件,如图1所示: 图1 设置keil输出批处理文件 在工程目录下找到输出的*.bat文件,如图2所示,则证明keil设置正确。 图2 查看是否正确输出 二、将Source Insight显示创建工具栏 ,打开选项卡View > Toolbars,选择Build Toolbar,正确操作后,工具栏会显示图3中的四个图标 图3 创建工具栏 三、打开选项卡Tools > Custom Commands…,选择Command中的Build Project,然后进行修改。在Run

printf() results in gibberish

你说的曾经没有我的故事 提交于 2019-12-01 12:07:56
I have this code: unsigned char *command = "0000"; unsigned char foo = (hex_char_to_int(command[0]) << 4) | hex_char_to_int(command[1]); unsigned char bar = (hex_char_to_int(command[2]) << 4) | hex_char_to_int(command[3]); printf("foo: %02x, bar: %02x\r\n", foo, bar); It uses this function: unsigned char hex_char_to_int(unsigned char ch) { switch (ch){ case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9; case 'A': return 0xA; case 'B': return 0xB;

printf() results in gibberish

笑着哭i 提交于 2019-12-01 10:55:41
问题 I have this code: unsigned char *command = "0000"; unsigned char foo = (hex_char_to_int(command[0]) << 4) | hex_char_to_int(command[1]); unsigned char bar = (hex_char_to_int(command[2]) << 4) | hex_char_to_int(command[3]); printf("foo: %02x, bar: %02x\r\n", foo, bar); It uses this function: unsigned char hex_char_to_int(unsigned char ch) { switch (ch){ case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4; case '5': return 5; case '6': return 6;

How does the linker know where is the definition of an extern function?

女生的网名这么多〃 提交于 2019-12-01 04:04:38
I read a few posts and concluded that extern tells compiler that "This function exists, but the code for it is somewhere else. Don't panic." But how does the linker know where the function is defined. My CASE:- I am working on Keil uvision 4. There is a header file grlib.h and the main function is in grlib_demo.c(it includes grlib.h). Now, there is a function GrCircleDraw() which is defined in Circle.c and called in grlib_demo.c, there is also a statement extern void GrCircleDraw(all arguments); in grlib.h. My query is how linker knows where the definition of GrCircleDraw() is since Circle.c

How does the linker know where is the definition of an extern function?

不羁的心 提交于 2019-12-01 01:29:49
问题 I read a few posts and concluded that extern tells compiler that "This function exists, but the code for it is somewhere else. Don't panic." But how does the linker know where the function is defined. My CASE:- I am working on Keil uvision 4. There is a header file grlib.h and the main function is in grlib_demo.c(it includes grlib.h). Now, there is a function GrCircleDraw() which is defined in Circle.c and called in grlib_demo.c, there is also a statement extern void GrCircleDraw(all

Keil uVision4和STC-ISPVer6.38等有关嵌入式系统软件的配置

懵懂的女人 提交于 2019-11-30 19:19:09
本次做的实习是嵌入式系统,嵌入式系统包含嵌入式硬件系统和嵌入式软件系统,现在来讲讲嵌入式软件系统。 本次实习所用到的嵌入式软件系统的工具有Keil uVision4 IDE、STC-ISPVer6.38下载软件和USB串口驱动。 首先安装USB串口驱动,像正常安装软件一样安装即可。 第二安装STC-ISPVer6.38下载软件,安装好之后选择好相应的单片机型号、串口号、以及硬件选项。配置好即可使用。如何使用呢?单机‘打开文件’按钮,选中要下载到单片机系统板里的HEX文件,接着点击下载/编程按钮即可完成操作,接下就是看效果了。 第三安装Keil uVision4 IDE,安装好之后要配置相应的环境,先是在STC-ISP中选择头文件,并且选中你所需要的单片机系列,如本次的STC15F2KXX、STC15L2kXX/.......,然后点击”添加MCU型号到Keil中“按钮,在弹出来的对话框中选中你已经安装的Keil uVision4所在的文件,选中到Keil文件即可,然后确定,这一步完成。其次是打开Keil uVision4,点击Project下的Options for Target ‘Target 1’,在弹出来的对话框中选中Output,把Create HEX File前面的复选框勾上,然后点击C51选项卡,看到下面的Include Paths,点击Include

ARM Cortex-M compiler differences

大憨熊 提交于 2019-11-30 18:05:34
I'm about to develop some firmwares for Cortex-M cores on STM32 processors using C for my projects, and searching on the web I've found a lot of different compilers: Keil, IAR, Linaro, Yagarto and GNU Tools for ARM Embedded Processors . I was wondering, what functional differences are there between these compilers that might influence my choice? For example as an enthusiast I don't need support or assistance from the vendor, and a limitation on the code size is OK for the moment. Also the ease of use is not a main concern since I like to learn (and for the moment I have both Keil Lite and