Is BitBanding supported in ML17

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

Is BitBanding supported in ML17

跳至解决方案
1,022 次查看
JHinkle
Senior Contributor I

Is BitBanding support in the KL17 family of micro's?

I don't see it in the documentation.

I thought it was core for all the Kinetis micro's.

Thanks.

Joe

Update:  I have since discovered it called BME for this family.

Can't find the file BME.h.

I found another post that gave a link to FRDM_KL25 but could not find the file within any of the downloads.

Is the file still available?

Thanks.

0 项奖励
回复
1 解答
861 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Joe,

I've attached the BME.h, and please refer to it for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
3 回复数
861 次查看
JHinkle
Senior Contributor I

Ping:

Thank you for the file.

Joe

0 项奖励
回复
862 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi Joe,

I've attached the BME.h, and please refer to it for details.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
861 次查看
admin6
Contributor III

Thank you Jeremy/Kerry/Ping, I have also found this useful, many months later.

It seems to cover different IDEs - good.

With the default default IDE settings on my MCUXpresso 11.1.1 BME.h generates 21 trivial warnings to remind that it might not be able to inline the code in all circumstances. This does not matter, it works just fine as far as I can tell and the machine-code was smaller than non BME code. Thank you.

So, using your excellent code I modified it to simpler macros that worked specifically for my target FRDM-KL27 evaluation board, possibly at the cost of your portability.

Surprisingly the macros generated a smaller binary and still worked properly after extensive testing.

There are interesting operational details to note when using BME that require clarification. So they are documented in the header.

I have attached the header file in the hope that it will help anyone - even if only the comments on BME details are useful.

Bear in mind this code is targeted at the KL27z MCU so the comments suggest the macros should only be used for peripheral address space registers as advised in the MCU KL27z32/64 reference manual.  Other MCUs might allow use with RAM. I tried Using Upper and lower RAM anyway and found that for BME access to one area a hard fault exception was generated, and for the other area no hard fault. So do NOTuse it for RAM unless your MCU explicitly supports it and you are certain which part of RAM is being accessed.

There are no asserts in the macros.

Regards, Rob

0 项奖励
回复