CAN example samples available for AN4258

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

CAN example samples available for AN4258

跳至解决方案
3,488 次查看
koauts
Contributor II

Hello, I previously saw an answer that CAN can be applied to the manual AN4258 using the s12xs64 chip.

 

The link below is for relevant inquiries :

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12X-How-to-used-msCAN-in-bootloader/m-p/17...

 

Are there any CAN sample examples of s12xs series that can be applied to the An4258 manual?

 

 

 
标记 (2)
0 项奖励
回复
1 解答
3,449 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

I would suggest you to read the principle of AN4258. It is short and easy to understand.

The handshake is solved by XON and XOFF protocol bit for dynamic data flow. There is a buffer in the MCU which is filled directly from PC and when it is full the XOFF is send from MCU to the PC to stop data flow. Then the MCU flashes the data. After they are flashed (buffer is empty) the XON is send from the MCU to the PC and data flows continues.

 

The AN4258 works:     PC(UART) <----    XON/XOFF driven Handshake  ----> MCU(UART)

 

The solutions you can use:

1) PC(UART)<->MCU_MASTER(UART/CAN) <-> MCU(CAN)

2) PC(CAN)<->MCU(CAN)

In both cases you can perform some dynamic handshake with filling and processing a buffer on MCU side or you can use static handshake when you send an exact and appropriate number of bytes to the MCU and wait (PC) for confirmation of data processing (MCU) to be able to send next data set.

 

The second option is, of course, better but you need some PC CAN interface and SW to control handshake.

 

So, finally if you exclude entire UART communication from AN4258 you can implement any data flow between your Master device and MCU via CAN.

 

Best regards,

Ladislav

在原帖中查看解决方案

0 项奖励
回复
6 回复数
3,472 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

as I wrote in previous answer. There is no CAN communication example related to AN4258. The examples mentioned in the previous answer shows how to use CAN and the implementation/porting is up to the engineer. One of the reasons why CAN protocol example was not made is that there must some master device with CAN communication which can communicate with the MCU with defined upper level protocol. The easiest way of such protocol is implemented in the AN4258 because there are simple possibilities of communication via UART. (Hyperterminal was used in past for development)

Best regards,

Ladislav

0 项奖励
回复
3,456 次查看
koauts
Contributor II

Thank you for answer.

I have more questions.

Does the need for a master device mean that the bootloader can be executed through master-slave communication?
example:
PC---(SCI)-->Master(mcu)---(CAN)-->Slave(mcu)---(SCI)-->PC

I was planning a bootloader that would simply exchange data with the PC solely through CAN communication.

So, would it be difficult to plan to expand the CAN module to AN4258SW and work only with CAN without serial communication such as SCI?

标记 (1)
0 项奖励
回复
3,455 次查看
koauts
Contributor II

Ultimately, the goal is to be able to perform the bootloader with just one MCU.

标记 (1)
0 项奖励
回复
3,450 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

I would suggest you to read the principle of AN4258. It is short and easy to understand.

The handshake is solved by XON and XOFF protocol bit for dynamic data flow. There is a buffer in the MCU which is filled directly from PC and when it is full the XOFF is send from MCU to the PC to stop data flow. Then the MCU flashes the data. After they are flashed (buffer is empty) the XON is send from the MCU to the PC and data flows continues.

 

The AN4258 works:     PC(UART) <----    XON/XOFF driven Handshake  ----> MCU(UART)

 

The solutions you can use:

1) PC(UART)<->MCU_MASTER(UART/CAN) <-> MCU(CAN)

2) PC(CAN)<->MCU(CAN)

In both cases you can perform some dynamic handshake with filling and processing a buffer on MCU side or you can use static handshake when you send an exact and appropriate number of bytes to the MCU and wait (PC) for confirmation of data processing (MCU) to be able to send next data set.

 

The second option is, of course, better but you need some PC CAN interface and SW to control handshake.

 

So, finally if you exclude entire UART communication from AN4258 you can implement any data flow between your Master device and MCU via CAN.

 

Best regards,

Ladislav

0 项奖励
回复
3,327 次查看
koauts
Contributor II

Can you provide information about the memory map of MC9S12XS64?

It is difficult to define vector table overrides and their location for the application.

标记 (1)
0 项奖励
回复
3,293 次查看
lama
NXP TechSupport
NXP TechSupport

Attached

L.

0 项奖励
回复