реклама на сайте
подробности

 
 
> Размещение кода функции в RAM, компилятор GCC
Poluektovich
сообщение Sep 18 2015, 15:55
Сообщение #1


Местный
***

Группа: Свой
Сообщений: 221
Регистрация: 15-09-08
Из: Зеленоград
Пользователь №: 40 201



Хочу чтобы код определенной функции выполнялся из RAM. Для этого следовал рекомендациям:
Цитата
Placing code in RAM using GCC
Gcc supports the use of the __attribute__ keyword which allows you to apply special attributes to your code. There are many attributes you can apply; the one we are interested in is section .
The section attribute places code in a specific memory section as defined in the cm3gcc.ld file. RAM is defined as the .data section. So, for example, if you wanted to place a function in RAM the code for the function prototype would look like this:
void foo (void) __attribute__ ((section(".data")));


Однако. код по-прежнему размещется во FLASH.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 18th July 2025 - 03:17
Рейтинг@Mail.ru


Страница сгенерированна за 0.01396 секунд с 7
ELECTRONIX ©2004-2016